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.