[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 11:59:25 PDT 2016


On Fri, May 6, 2016 at 11:31 AM, John McCall <rjmccall at gmail.com> wrote:
> rjmccall added a comment.
>
> 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 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