* Ofek Shilon:
> It appears from brief testing (just gcc/x64) that this is not the
> mechanism in use today: Taking the address of a function makes the
> compiler mark its reloc as R_X86_64_GLOB_DAT instead of
> R_X86_64_JUMP_SLOT, making it bind at load time. Taking the function
> address then appears to deref its GOT entry - and not take the address
> of its PLT entry.
This behavior you observe is specific to position-independent
executables. Your toolchain appears to create them by default.
When the ABI speaks of “executable”, nowdays you need to read that as
“position-dependent executable” (an ET_EXEC object).
If I understand things correctly, the ET_EXEC behavior breaks the
implementation of protected symbols, which is probably why it wasn't
retained for ET_DYN executables. I think the glibc dynamic linker would
show the expected behavior for non-zero st_value in SHN_UNDEF symbols.
Thanks,
Florian