[PATCH] D19995: Optimize access to global variable references in PIE mode when linker supports copy relocations for PIE

Joerg Sonnenberger via llvm-commits llvm-commits at lists.llvm.org
Sun May 8 08:40:24 PDT 2016


On Sun, May 08, 2016 at 08:12:30AM -0700, H.J. Lu wrote:
> Lazy binding in PLT has indirect branch to the writable GOT slot.
> Both have security consequences.  Is it desirable to update x86
> psABI to make copy relocation and PLT optional to tighten security?

Lazy PLT binding can be handled differently by the dynamic linker, there
are different options like replacing the full slot with a 16byte cmpxchg
to turn it into a single call instruction. With kernel assistance, that
can be done without userland-writeable PLT. Copy relocations should
just be verboten for PIE, all the performance improvements can be
realised without them.

Joerg


More information about the llvm-commits mailing list