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]

RFC: Sort input section by list


Hi,

I got a request for a new linker feature to sort input sections by a
list provided
at command line. I am investigating the following approach:

1. Change --sort-section to accept a linker script with a list of sections.
2. The linker script is similar to version script

.text {
  extern "C++"
  {
    foo(int);
  };
};

where .text will be the prefix of section name. It will match .text._Z3fooi.
3. Linker will insert .text._Z3fooi before ".text.*" in linker script, to turn

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

into

.text           :
{
    *(.text .stub .text._Z3fooi. .text.* .gnu.linkonce.t.*)
}
4. Multiple  --sort-section will be supported.

Any comments?

Thanks.


-- 
H.J.


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