[llvm] r221150 - Emit .eh_frame with relocations to functions, rather than sections
Rafael EspĂndola
rafael.espindola at gmail.com
Wed Nov 5 05:46:43 PST 2014
>> Unfortunately, this causes gold to crash when run with
>>
>> ld -shared -o test.so test.o /usr/lib/gcc/x86_64-redhat-linux/4.8.3/crtendS.o
>
> Hmmm. Yes, that would be a bug. At least with .eh_frame sections,
> there's no real need to do this.
Fortunately the bug was just with the missing SHF_ALLOC, not the
comdat: https://sourceware.org/bugzilla/show_bug.cgi?id=17556
changing the .s a bit to
.section .text.foo,"axG", at progbits,foo,comdat
.Local1:
nop
.section .eh_frame,"aG", at progbits,foo,comdat
.long .Local1 - .
.section .text.bar,"axG", at progbits,bar,comdat
.Local2:
nop
.section .eh_frame,"aG", at progbits,bar,comdat
.long .Local2 - .
causes everything to work.
So while this would not be required for existing linkers, we could do
it if desired. It would be a tiny bit more efficient by allowing the
linker to not even read some of the .eh_frame sections, no?
Cheers,
Rafael
More information about the llvm-commits
mailing list