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

Sriraman Tallam via llvm-commits llvm-commits at lists.llvm.org
Fri May 6 12:11:53 PDT 2016


tmsriram added a comment.

In http://reviews.llvm.org/D19995#423712, @rjmccall wrote:

> The semantic argument against using copy relocations by default is that they hard-code the size of the variable at link time.  What's the story here for that?


I am repeating a comment I already made to keep everything in Phabricator.

I am no copy relocations expert but like it or not, copy relocations are used today by default in non-PIE mode.  What kind of bugs do you see with copy  relocations?  This comes to my mind https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68016  but this problem exists without copy relocations too.

If it is not already clear, all I am saying is non-PIE code gen knows a way to avoid extra loads for global accesses.  Let's exploit that for PIE too!


http://reviews.llvm.org/D19995





More information about the llvm-commits mailing list