[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
Mon May 9 14:20:13 PDT 2016
On Mon, May 9, 2016 at 2:07 PM, Joerg Sonnenberger via llvm-commits
<llvm-commits at lists.llvm.org> wrote:
> On Thu, May 05, 2016 at 09:19:46PM +0000, Sriraman Tallam via llvm-commits wrote:
>> For X86, in PIE mode, when accessing extern global variables, an extra
>> load from the GOT can be avoided if the linker allows copy relocations
>> for PIE. This patch makes it possible. This is already available in
>> the GCC compiler.
>
> OK, let's go back to original goal and look at better ways to achieve
> this. Can we agree on the problem first:
>
> (1) The main program consists of one or more compile units. It declares
> non-static file-scope variables.
Just to be clear, How is this different from global variables?
> (2) LTO may or may not be used.
> (3) The goal is to access defined variables without the penalty of the
> GOT.
>
> Do we agree on this so far?
Yes, this looks correct assuming you meant global variables.
>
> Joerg
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits
More information about the llvm-commits
mailing list