maintaining LMA-VMA delta
Nathan Sidwell
nathan@codesourcery.com
Thu Apr 2 14:16:00 GMT 2009
The linker's manual specifies:
"If neither @code{AT} nor @code{AT>} is specified for an allocatable
section, the linker will set the LMA such that the difference between
VMA and LMA for the section is the same as the preceding output
section in the same region. If there is no preceding output section
or the section is not allocatable, the linker will set the LMA equal
to the VMA."
This patch makes the linker do what that documentation specifies when using AT>.
the current behaviour for something like
.foo { ... } >bar AT>baz
.bar { ... > >bar
will set .bar's LMA to it's VMA, rather than place the LMA after foo's placement
in baz. That's contrary to what the document specifies.
This patch set's the lma_region on an output section iff
*) the user's not specified a load_base or lma_region
*) this section and the previous section were for the same region
*) the previous section has an lma_region (well, actually we copy NULL in that
case, which is equivalent).
This does have the potential of breaking linker scripts that relied on the
linker's implemented behaviour, rather than documented behaviour. the
alternative is to fix the documentation of course :)
tested in i686-pc-linux-gnu, ok?
nathan
--
Nathan Sidwell :: http://www.codesourcery.com :: CodeSourcery
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: all.diff
URL: <https://sourceware.org/pipermail/binutils/attachments/20090402/6edcef96/attachment.ksh>
More information about the Binutils
mailing list