RFC: Sort input section by list

Arjan van de Ven arjan@linux.intel.com
Tue Aug 26 18:04:00 GMT 2008


Nick Clifton wrote:
> Hi Arjan,
> 
>> I suppose we chose differently; from a distro point of view patching 
>> each app's code that big
>> is a no go for us; once the new binutils is released we can automate 
>> and use the new feature
>> pretty quickly.
>> Add to this that which functions are on the list will also depend on 
>> which arguments you pass to configure...
>> sorry but really the "just patch the code in 3000 places" is really 
>> not going to work ;-(
> 
> Would you agree that if a using-currently-available-tools process could 
> be automated then it would be an acceptable solution to you ?
> 
> Lets assume that you have gotten to the stage where you have the 
> profiled list of functions in the order you wish them to appear in the 
> final binary.  Lets also assume that you have compiled the sources with 
> -ffunction-sections.  You could use a sed/awk script to convert the 
> function names into a linker script fragment that specifically 
> references each of the function sections by name. Then all you would 
> need is a slightly modified default linker script that INCLUDEs this 
> constructed fragment at the right place in the generic linker script.
> 
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.





More information about the Binutils mailing list