This is the mail archive of the binutils@sourceware.org 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: ALIGN directive showing different behavior than documented


On 08/06/2015 12:37 AM, Alan Modra wrote:
On Mon, Aug 03, 2015 at 01:53:11PM -0600, Sandra Loosemore wrote:
On 08/02/2015 11:19 PM, Alan Modra wrote:

Against that, you've found some questionable linker scripts that now
misbehave.  I'm saying they are questionable because ". = ALIGN (8);"
inside a section that is only "ALIGN (4)" is at the heart of the
problem, and I reckon the linker scripts you have are newer than the
description of ALIGN that you quote above.  ie. The scripts are
relying on undocumented behaviour.

Using an ALIGN expression with an alignment greater than that of its
enclosing section is absolutely not undocumented behavior.  Both the current
ld manual and the one from 1993 include such an example.

You're correct.  I should have looked at what the docs said before
replying.  The description of ALIGN that you quoted and I was
responding to, has been removed from the current ld docs.  We no
longer say that ALIGN is equivalent to
"(. + @var{exp} - 1) & ~(@var{exp} - 1".
(That went in 2002 with commit 3c6706bb.)

Reverts a2c59f28 and e474ab13.  Since the unary form of ALIGN only
references "dot" implicitly, there isn't really a strong argument for
making ALIGN use a relative value when inside an output section.

Many thanks for reconsidering this! From an abstract perspective, it probably does make more sense for ALIGN to be relative within a section and to disallow (or at least warn about) attempts to align to a boundary larger than the section alignment, but I think breaking such long-standing behavior is a more critical problem.

-Sandra


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