This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: RFC: Sort input section by list
On Tue, Aug 26, 2008 at 12:19 PM, Daniel Jacobowitz <drow@false.org> wrote:
> On Tue, Aug 26, 2008 at 09:42:47AM -0700, Arjan van de Ven wrote:
>> I've done this before (at my previous employer); it includes getting gcc to dump its linker
>> script, then running a perl/sed script on it to add this and then finding a way
>> to get this linker script used. So far so good.
>> it just becomes impossible in an autoconf/automake/libtool world...
>> unless we do a gross hack and have an environment variable for such a lookaside linker script instead
>> (LD_SCRIPT_PREINCLUDE?).. that would solve the issue as well.
>
> In the latest linker sources Alan's added bits to support additional
> linker scripts, instead of replacing the default script. Then it
> reduces to adding an option to the compile command and I'm sure the
> distro build process can manage that for most packages.
>
Alan added:
`INSERT [ AFTER | BEFORE ] OUTPUT_SECTION'
This command is typically used in a script specified by `-T' to
augment the default `SECTIONS' with, for example, overlays. It
inserts all prior linker script statements after (or before)
OUTPUT_SECTION, and also causes `-T' to not override the default
linker script. The exact insertion point is as for orphan
sections. *Note Location Counter::. The insertion happens after
the linker has mapped input sections to output sections. Prior to
the insertion, since `-T' scripts are parsed before the default
linker script, statements in the `-T' script occur before the
default linker script statements in the internal linker
representation of the script. In particular, input section
assignments will be made to `-T' output sections before those in
the default script. Here is an example of how a `-T' script using
`INSERT' might look:
I don't think it supports sorting input sections.
BTW, this new feature isn't mentioned in ld/NEWS.
--
H.J.