[REINSTATED] Re: [PATCH,trunk+2.20.1] Extend COFF .section directive syntax to specify alignment.

Dave Korn dave.korn.cygwin@googlemail.com
Sat Jan 23 19:02:00 GMT 2010


On 22/01/2010 04:34, Alan Modra wrote:
> On Thu, Jan 21, 2010 at 04:08:21PM +0000, Dave Korn wrote:
>>   What I should have said was: There is currently no way to specify an
>> alignment *less than the default section alignment* for a section:
> 
> I see.
> 
>> or should I revive this patch?
> 
> Possibly.  Another option would be to invent a new assembler directive
> that resets alignment, or extend existing alignment directives to do
> the same.  eg.  ".p2align -1" could align to 2 bytes even if previous
> section alignment was higher.

  Well, I don't like the idea of changing .p2align; its job is to adjust the
location pointer, and it only adjusts the section alignment upward
incidentally, because it "has to" rather than because it particularly "wants
to"; making that part of its primary purpose would seem like semantically
overloading it to me.  Adding a new directive wouldn't be as confusing as
that, but it seems overkill to me: the alignment is a property of a section
and it makes sense to me to set it at the same time as other properties of the
section are set, when it is created in the .section directive.

  So, unless anyone actually objects within say 48 hours, I'll apply this
patch to HEAD.  Tristan, how do you feel about putting it on the branch too?

    cheers,
      DaveK

-------------- next part --------------
A non-text attachment was scrubbed...
Name: coff-section-directive-alignment-reinstated.diff
Type: text/x-c
Size: 8766 bytes
Desc: not available
URL: <https://sourceware.org/pipermail/binutils/attachments/20100123/91d80fb3/attachment.bin>


More information about the Binutils mailing list