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: RFC: Sort input section by list


On Tue, Aug 26, 2008 at 12:45:01PM -0700, H.J. Lu wrote:
> `INSERT [ AFTER | BEFORE ] OUTPUT_SECTION'
> 
> I don't think it supports sorting input sections.

Taking your example, you said you wanted to insert .text._Z3fooi.
amongst other text sections like this:

.text           :
{
    *(.text .stub .text._Z3fooi. .text.* .gnu.linkonce.t.*)
}

It's true that INSERT would not give exactly the same result as the
above, but your example doesn't actually do any sorting!  You probably
meant

.text :
{
    *(.text .stub) *(.text._Z3fooi.) *(.text.* .gnu.linkonce.t.*)
}

You could do this by writing a separate script with

SECTIONS {
  .text : { *(.text .stub) *(.text._Z3fooi.) }
}
INSERT AFTER .init;

Actually, it would be nicer if we could use "INSERT BEFORE .text;"
here, but I think that won't work at the moment.

> BTW, this new feature isn't mentioned in ld/NEWS.

I'll add an entry when I fix the "INSERT BEFORE .text;" issue.

-- 
Alan Modra
Australia Development Lab, IBM


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