public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
* obj-coff.c: coff_frob_section patch
@ 2000-07-11 13:33 Mark E.
  0 siblings, 0 replies; 4+ messages in thread
From: Mark E. @ 2000-07-11 13:33 UTC (permalink / raw)
  To: binutils

Hi guys,

When the last section is aligned for a COFF target using BFD, garbage is 
written out unless padding is added.

gas/Changelog:

2000-07-11  Mark Elbrecht  <snowball3@bigfoot.com>

	* config/obj-coff.c (coff_frob_section): Add padding to the last
	  section when aligning it increases its size.

Index: src/gas/config/obj-coff.c
===================================================================
RCS file: /cvs/src/src/gas/config/obj-coff.c,v
retrieving revision 1.28
diff -c -p -r1.28 obj-coff.c
*** obj-coff.c	2000/07/06 17:21:00	1.28
--- obj-coff.c	2000/07/11 20:30:58
*************** coff_frob_section (sec)
*** 1489,1496 ****
  #if !defined(TICOFF)
    if (size & mask)
      {
!       size = (size + mask) & ~mask;
!       bfd_set_section_size (stdoutput, sec, size);
      }
  #endif
  
--- 1489,1508 ----
  #if !defined(TICOFF)
    if (size & mask)
      {
!       bfd_vma new_size;
!       fragS *last;
!       
!       new_size = (size + mask) & ~mask;
!       bfd_set_section_size (stdoutput, sec, new_size);
! 
!       /* If the size had to be rounded up, add some padding in
!          the last non-empty frag.  */
!       fragp = seg_info (sec)->frchainP->frch_root;
!       last = seg_info (sec)->frchainP->frch_last;
!       while (fragp->fr_next != last)
!         fragp = fragp->fr_next;
!       last->fr_address = size;
!       fragp->fr_offset += new_size - size;
      }
  #endif
  

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: obj-coff.c: coff_frob_section patch
@ 2000-07-12  9:46 Nick Clifton
  0 siblings, 0 replies; 4+ messages in thread
From: Nick Clifton @ 2000-07-12  9:46 UTC (permalink / raw)
  To: snowball3; +Cc: binutils

Hi Mark,

: > : 	* config/obj-coff.c (coff_frob_section): Add padding to the last
: > : 	  section when aligning it increases its size.
: > 
: > Approved.
: 
: >  2000-07-11  Mark Elbrecht  <snowball3@bigfoot.com>
: > : 
: > : 	* scripttempl/i386go32.sc: Support the g++ attribute init_priority in
: > : 	  gcc 2.95.2 and later.
: > 
: 
: To be applied later?

Sorry dude.  I thought that you had write access.  I have now applied
both of these patches.

Cheers
	Nick

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: obj-coff.c: coff_frob_section patch
  2000-07-11 14:41 Nick Clifton
@ 2000-07-12  6:17 ` Mark E.
  0 siblings, 0 replies; 4+ messages in thread
From: Mark E. @ 2000-07-12  6:17 UTC (permalink / raw)
  To: Nick Clifton, binutils

Hi Nick,

> : 	* config/obj-coff.c (coff_frob_section): Add padding to the last
> : 	  section when aligning it increases its size.
> 
> Approved.

>  2000-07-11  Mark Elbrecht  <snowball3@bigfoot.com>
> : 
> : 	* scripttempl/i386go32.sc: Support the g++ attribute init_priority in
> : 	  gcc 2.95.2 and later.
> 

To be applied later?

Mark

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: obj-coff.c: coff_frob_section patch
@ 2000-07-11 14:41 Nick Clifton
  2000-07-12  6:17 ` Mark E.
  0 siblings, 1 reply; 4+ messages in thread
From: Nick Clifton @ 2000-07-11 14:41 UTC (permalink / raw)
  To: snowball3; +Cc: binutils

Hi Mark,

: 2000-07-11  Mark Elbrecht  <snowball3@bigfoot.com>
: 
: 	* config/obj-coff.c (coff_frob_section): Add padding to the last
: 	  section when aligning it increases its size.

Approved.

Cheers
	Nick

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2000-07-12  9:46 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2000-07-11 13:33 obj-coff.c: coff_frob_section patch Mark E.
2000-07-11 14:41 Nick Clifton
2000-07-12  6:17 ` Mark E.
2000-07-12  9:46 Nick Clifton

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).