https://sourceware.org/bugzilla/show_bug.cgi?id=26815
--- Comment #5 from H.J. Lu <hjl.tools at gmail dot com> --- (In reply to Thiago Macieira from comment #4) > (In reply to H.J. Lu from comment #3) > > GOT relocation is needed for function pointer comparison. > > > > > Either way, the fact that gold and ld.bfd behave different is a problem. > > > And > > > so is the fact that passing an empty --dynamic-list file causes it to > > > work. > > > > An empty --dynamic-list file is the same as -Bsymbolic. > > I see. > > Then this is an incompatibility between compiler and linker: the compiler > sees a protected symbol and emits a relocation assuming it doesn't need > indirect access via the GOT to do a pointer comparison, but ld.bfd says it > should. > > Anyway, this is what I am asking to change: when a symbol is protected, the > compiler optimisation should be allowed and pointer comparison still works > provided ALL users use the GOT too. That includes the executable. This is an ABI change. We have 2 choices 1. Extend GNU_PROPERTY_NO_COPY_ON_PROTECTED to cover protected function pointers. We can rename it to GNU_PROPERTY_LOCAL_PROTECTED, Or 2. Add a new property for protected function pointers. Please raise the issue at https://gitlab.com/x86-psABIs/Linux-ABI This will require support in GCC, linker and ld.so. -- You are receiving this mail because: You are on the CC list for the bug.
