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

Rafael EspĂ­ndola via llvm-commits llvm-commits at lists.llvm.org
Tue May 10 07:13:46 PDT 2016


On 10 May 2016 at 08:44, Joerg Sonnenberger via llvm-commits
<llvm-commits at lists.llvm.org> wrote:
> 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.
>

Note that that command line option only marks *definitions* as protected.

Cheers,
Rafael


More information about the llvm-commits mailing list