[PATCH] Allow direct access relocations referencing a protected function symbol

Alan Modra amodra@gmail.com
Mon Jun 14 13:20:32 GMT 2021


On Sun, Jun 13, 2021 at 02:54:00PM -0700, Fangrui Song via Binutils wrote:
> This fixes the bogus "relocation R_* against protected symbol `foo'
> can not be used when making a shared object" for function symbols for
> at least aarch64/i386/x86-64.
> 
> The controversial "copy relocations on protected data symbols" (which has some
> fragile glibc support) is irrelevant to function symbols.

No, this patch doesn't do that.  What you are doing here will disable
dynamic relocations on protected function symbols in shared libraries.
That will break function pointer comparison for architectures that
implement non-pic executables, where a function that is undefined in
the executable is given a fixed address in the executable, that of its
plt call code.

-- 
Alan Modra
Australia Development Lab, IBM


More information about the Binutils mailing list