[lld] r289045 - [ELF] ifunc implementation using synthetic sections

Peter Smith via llvm-commits llvm-commits at lists.llvm.org
Thu Dec 8 06:26:50 PST 2016


Not without risking breaking existing programs unfortunately. Glibc
processes the .rel.dyn before the .rel.plt so an ifunc resolver in
.rel.dyn cannot directly call any function that needs a .got.plt entry
set up. This can be worked around by calling via a function pointer as
the relocation will be in .rel.dyn and resolved before the ifunc
resolver. I found this out the hard way when building some tests on
ARM.

There are also some more (undocumented) restrictions on architectures
that use .rel.dyn for all irelative resolvers
https://bugzilla.redhat.com/show_bug.cgi?id=1312462

I thought it would be best to follow the ld.bfd conventions for the
architecture to maximise compatibility.

Peter

On 8 December 2016 at 14:13, Rafael Avila de Espindola
<rafael.espindola at gmail.com> wrote:
>> A secondary benefit is that for ARM we can move the IgotPltSection and its
>> dynamic relocations to the .got and .rel.dyn as the ARM glibc expects all
>> the R_*_IRELATIVE relocations to be in the .rel.dyn
>
> Could we use .rel.dyn for all architectures and avoid some of the
> checks?
>
> Cheers,
> Rafael


More information about the llvm-commits mailing list