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: [RFC PATCH] .bundle_align_mode

On 02/16/2012 03:01 AM, nick clifton wrote:

> I was also considering the case where a linker script (or user) specifies an alignment for a section that is less than a bundle's alignment.  Or when the user links with the --nmagic command line option.  Both of these can break bundle alignment.   Hmm, but they break section alignment requirements
> in general and the linker does not complain about that.  So I guess that it is caveat-user.  If you request a reduced alignment then you should know what you are doing.

The linker ought to check and ought to warn if the specified output alignment
is less than the specified input alignment, even if by accident the input
alignment happens to be met by the current instantiated output.  The assembler
already maximizes the operands of all .{b,p2,}align in order to compute the
ElfXX_Shdr.sh_addralign. If the linker does not check (or similarly maximize)
when aggregating Sections, then that's a violation of the implicit contract.
Such a violation can have mysterious effects and be hard to find.  Detecting
such a mismatch is exactly the kind of inexpensive-but-powerful check
that robust software should perform.


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