This is the mail archive of the 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: PATCH: Don't align text/data/bss sections in x86 assembler

On Tue, Jun 4, 2013 at 12:09 AM, Jan Beulich <> wrote:
>>>> On 03.06.13 at 17:27, "H.J. Lu" <> wrote:
>> On Mon, Jun 3, 2013 at 1:25 AM, Jan Beulich <> wrote:
>>>>>> On 31.05.13 at 19:32, "H.J. Lu" <> wrote:
>>>> There is no need to align text/data/bss sections for ELF in x86
>>>> assembler.  The alignment directive should be used if a symbol needs
>>>> a specfic alignment.  I checked in this patch to avoid align
>>>> text/data/bss sections in x86 assembler.
>>> Are you reasonably sure that this will not result in regressions?
>>> While conceptionally I agree with the change (and never
>>> understood why the alignment was being enforced), I think such
>>> a change should only be done by providing a command line option
>>> to suppress the automatic alignment.
>> I thought about it and decided against it.  The section
>> alignment is very arbitrary:
>> 1. Many arches don't do it.
>> 2. Only x86 ELF did it.
>> 3. It only aligned text/data/bss sections and there are many
>> other sections with code and data which aren't aligned.
>> 4. Neither gABI nor psABI require it.
> These are all valid points, but neglect the (from my pov) most
> important aspect here: Assembly code is bound to the arch (i.e.
> point 1 isn't really meaningful), often also bound to the object
> format (i.e. point 2 isn't very meaningful either). And people
> doing simple things with as little code as possible are likely to be
> at risk the most (largely voiding 3 and 4): Having got used to
> simply write ".data" or ".bss" followed by simple data items would
> automatically take care of minimal alignment, I would bet many
> aren't even aware of the need to put in some form of ".align".
> For text this likely is less of an issue, but you never know.

Given that

1. I want to assembler to generate smallest binary size by default.
2. x86 isn't a strict alignment target.
3. An align directive should/can be used to specify

I will keep the way it is.


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