[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 11:29:47 PDT 2016
On Tue, May 10, 2016 at 10:13:46AM -0400, Rafael EspĂndola wrote:
> 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.
But then it only helps for codegen for defined symbols, not for those
used in another file.
Joerg
More information about the llvm-commits
mailing list