This is the mail archive of the binutils@sources.redhat.com mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: hppa build broken


> I'm not convinced that this is correct.  Both bcount and extra could
> be zero.  0 is the default value for .block.  Thus, I don't think
> the first frag_var should be created when bcount is zero.  Also, bcount
> and extra probably should be unsigned int's.

Hm, didn't think about a size of zero.  Here is an updated patch.  I am
not sure if I need to call frag_var at all if I have a temp_size of
zero, but I put it in.  The regression tests worked with or without the
check for "(bcount == 0 && extra == 0)" but it seemed safer to put it
in and duplicate the existing behavour.

Steve Ellcey
sje@cup.hp.com


gas/Changelog

2005-06-15  Steve Ellcey  <sje@cup.hp.com>

	* config/tc-hppa.c (pa_block): Use bigger blocks to write zero.


*** src.orig/gas/config/tc-hppa.c	Wed Jun 15 11:52:46 2005
--- src/gas/config/tc-hppa.c	Wed Jun 15 15:43:44 2005
*************** pa_align (bytes)
*** 5933,5938 ****
--- 5933,5940 ----
  
  /* Handle a .BLOCK type pseudo-op.  */
  
+ #define BFRAG_SIZE (1024*1024)
+ 
  static void
  pa_block (z)
       int z ATTRIBUTE_UNUSED;
*************** pa_block (z)
*** 5954,5961 ****
    else
      {
        /* Always fill with zeros, that's what the HP assembler does.  */
!       char *p = frag_var (rs_fill, 1, 1, 0, NULL, temp_size, NULL);
!       *p = 0;
      }
  
    pa_undefine_label ();
--- 5956,5978 ----
    else
      {
        /* Always fill with zeros, that's what the HP assembler does.  */
!       unsigned int bcount = temp_size / BFRAG_SIZE;
!       unsigned int extra = temp_size - (bcount * BFRAG_SIZE);
!       if (bcount > 0)
! 	{
! 	  char *p = frag_var (rs_fill, BFRAG_SIZE, BFRAG_SIZE, 0, NULL, bcount, NULL);
! 	  memset (p, 0, BFRAG_SIZE);
! 	}
!       if (extra > 0)
! 	{
! 	  char *p = frag_var (rs_fill, extra, extra, 0, NULL, 1, NULL);
! 	  memset (p, 0, extra);
! 	}
!       if (bcount == 0 && extra == 0)
! 	{
! 	  char *p = frag_var (rs_fill, 1, 1, 0, NULL, 0, NULL);
! 	  memset (p, 0, 1);
! 	}
      }
  
    pa_undefine_label ();


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]