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 9:42 AM, Arjan van de Ven <arjan@linux.intel.com> wrote:
>>
>> 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.
>

I am glad to see there are so many feedbacks. My original suggestion
may not be the best approach. I'd like to see examples of other linker
options if possible.

My goals for this new linker features are

1. Users only need to provide lists of sections.
2. The list should support C, C++, Java.
3. The list should work with arbitrary sections.
4. Users don't need to change the default linker script.

Does anyone have other requirements/suggestions?

Thanks.


-- 
H.J.


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