[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
Tue May 10 05:44:47 PDT 2016


On Mon, May 09, 2016 at 07:04:04PM -0400, Rafael EspĂ­ndola via llvm-commits wrote:
> Another easy one that might produce close results is building the main program with
> -fvisibility=protected. That will mark every definition protected and
> avoid some got uses. The linker will hopefully optimize the others.

This one sadly doesn't work. See my questions on the ELF lists -- if a
symbol is marked as protected, it must be defined in the same DSO. That
sadly makes it much less useful than it could be.

Joerg


More information about the llvm-commits mailing list