This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
RFC: Sort input section by list
- From: "H.J. Lu" <hjl dot tools at gmail dot com>
- To: binutils <binutils at sourceware dot org>, arjan at linux dot intel dot com
- Date: Mon, 25 Aug 2008 16:51:49 -0700
- Subject: 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.