[llvm-dev] [RFC] Making .eh_frame more linker-friendly

George Rimar via llvm-dev llvm-dev at lists.llvm.org
Wed Nov 29 04:58:56 PST 2017


>>> With GNU gold (GNU Binutils 2.29.51.20171006) 1.14 have an assert:
>>> ~/LLVM/Release/bin/clang++ test.cpp -ffunction-sections -o test.o
>>> /usr/local/bin/ld: internal error in layout_eh_frame_section, at
>>> .././../gold/object.cc:1309
>>> It is that place:
>>> https://github.com/gittup/binutils/blob/gittup/gold/object.cc#L1372
>>> Did not investigate it, but it looks it is place
>>> (https://sourceware.org/ml/binutils/2009-06/msg00097.html)
>>> mentioned in comment for
>>> https://marc.info/?l=llvm-commits&m=144683596826489.
>>
>>I've committed a patch in gold that should fix this problem:
>>
>>   https://sourceware.org/ml/binutils/2017-11/msg00541.html
>>
>>Can you try gold again with this patch applied? You should at least
>>get a little further.
>>
>>If it still doesn't work, could I trouble you for a sample object file?
>>
>>-cary
>
>I'll try it soon and return with results, thanks !

I can confirm your patch fixes gold behavior.

I built latest binutils and performed benchmark tests again today.
Following versions of linkers were used:
* GNU ld (GNU Binutils) 2.29.51.20171129
* GNU gold (GNU Binutils 2.29.51.20171129) 1.14
* LLD 6.0.0 (trunk 319302) (compatible with GNU linkers)

--no-threads was set for gold and LLD tests.

Clang link time with single .eh_frame section in objects.
* ld.bfd:  2,940055212 seconds time elapsed  ( +-  0,17% ) (t1)
* ld.gold: 0,994370076 seconds time elapsed  ( +-  0,11% ) (t2)
* LLD:     0,445566042 seconds time elapsed  ( +-  0,32% ) (t3)

Clang link time with multiple .eh_frame sections in objects.
(latest diff 3 of https://reviews.llvm.org/D40352 applied to produce them).
* ld.bfd:  3,792698701 seconds time elapsed  ( +-  0,19% ) (1,29*t1)
* ld.gold: 1,135187654 seconds time elapsed  ( +-  0,10% ) (1,1416*t2)
* LLD:     0,506076638 seconds time elapsed  ( +-  0,31% ) (1,1358*t3)

George.


More information about the llvm-dev mailing list