On Fri, Dec 23, 2016 at 12:11 PM, Joerg Sonnenberger <jo...@bec.de> wrote:
> On Fri, Dec 23, 2016 at 11:27:15AM -0800, Philip Guenther wrote:
>> This is a form we use inside _libc_ so that calls to those functions
>> generated by gcc will be redirected to aliases with hidden visibility
>> and thus be local calls, without using the PLT.  If that won't work
>> with clang, then we'll want to figure out some other way to get the
>> calls to those functions generated by the compiler to be local calls
>> inside libc.
>
> I'm not sure about all possible platforms, but for all I can think of,
> it is enough if the target is hidden.

Making memcpy hidden is fine for ld.so, but not for libc, thus the
alias and asm rename dance we're currently using.


> In that case ld should be using
> a direct jump/call to the destination without creating a PLT entry.

The linker can eliminate the PLT entry and double-jump, but it
currently can't reoptimize the calling functions when %ebx is no
longer needed for holding the GOT offset for the PLT call.  LTO is
getting better, I guess, but it was nice getting the Right Thing
without requiring it.  <shrug>


Philip Guenther

Reply via email to