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

Xinliang David Li via llvm-commits llvm-commits at lists.llvm.org
Sat May 7 11:00:42 PDT 2016


On Fri, May 6, 2016 at 12:42 PM, Joerg Sonnenberger <joerg at netbsd.org>
wrote:

> joerg added a subscriber: joerg.
> joerg added a comment.
>
> This looks like a huge step in the wrong direction to me. Copy relocations
> are one of the worst misfeatures of ELF.


You have an interesting opinion here. Copyreloc is of course not without
its own problems, but it is effective and is already adopted by for non-PIE
build which performance critical programs need.    Note that this patch is
just an incremental change.


> Please do not add any new dependencies.
>
> That said, if the original motivation is simplifying access to variables
> of the main program (not in shared libraries), the linker can already
> optimize them.
>
>
>
At the cost of larger instruction footprint and waste of icache which is
precious.

Having said that, with LTO or ThinLTO, the compiler should be able do get
it right and know where the globals are defined.

David




> http://reviews.llvm.org/D19995
>
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160507/c2db275b/attachment.html>


More information about the llvm-commits mailing list