[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
Mon May 9 07:53:11 PDT 2016


On Mon, May 09, 2016 at 07:30:20AM -0700, H.J. Lu wrote:
> > The original ABI design was static linking and dynamic linking of the
> > main program from exactly the same object files. Using GOT-style
> > relocations is prohibitive on all platforms without cheap PC-relative
> > addressing. This includes for example i386. I don't know why amd64
> 
> You can use the new R_386_GOT32X relocation to access the
> GOT in executable with the base register, like
> 
> movl $foo at GOT, %eax
> movl foo at GOT, %eax
> 
> But not all linkers can relocate it properly.

But that still requires the base register to be set up?

Joerg


More information about the llvm-commits mailing list