[PATCH] D19528: [ELF] - Implemented -z combrelocs/nocombreloc.

George Rimar via llvm-commits llvm-commits at lists.llvm.org
Thu Apr 28 05:10:55 PDT 2016


>On 28 April 2016 at 05:17, George Rimar <grimar at accesssoftek.com> wrote:
>>>On 26 April 2016 at 06:30, George Rimar <grimar at accesssoftek.com> wrote:
>>>> grimar created this revision.
>>>> grimar added reviewers: ruiu, rafael.
>>>> grimar added subscribers: grimar, llvm-commits.
>>>>
>>>> This is the option which sorts relocs to optimize dynamic linker performance.
>>>> -z combelocs is the default in gold, also it ignores -z nocombreloc
>>>> (https://sourceware.org/bugzilla/show_bug.cgi?id=11062), so I guess we can do the same.
>>>> So this patch does not add handling of these options, just ignores them,
>>>> but adds sorting of relocations before writing them to rel[a].dyn section.
>>>>
>>>> Details about option (taken from http://people.redhat.com/jakub/prelink.pdf, p.2):
>>>
>>>
>>>Does this have any application outside of prelinking? As far as I can
>>>tell that is pretty much dead.
>>>
>>>Cheers,
>>>Rafael
>>
>> May be I am missing something, but I think -z combreloc is usefull ant
>> very actual nowadays (up to 16% load time boost according to Ian Lance Taylor):
>> http://www.airs.com/blog/archives/186
>
>Can you run some benchmark? A shared build of clang might be a good example.
I`ll try tomorrow.

>
>Also, that refers only to sorting. We should *not* be setting the
>extra DT_* values. 
As far I understood from prelink.pdf, there is still possible speedup after if doing that:

"If the load offset is non-zero, the dynamic linker can still make use of this dynamic tag, as relative relocation handling is typically way simpler than handling other relocations (since symbol lookup is not necessary) and thus it can handle all relative relocations in a tight loop in one
place and then handle the remaining relocations with the fully featured relocation handling routine."

>And since we are only interested in speeding up
>startup, we don't need to sort based on the relocation being relative
>or not.
>
>Cheers,
>Rafael

George.


More information about the llvm-commits mailing list