This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH] Don't use PLT nor GOT in libc.a [BZ #20750]
On Mon, Nov 7, 2016 at 8:03 AM, Florian Weimer <fweimer@redhat.com> wrote:
> On 11/04/2016 08:25 PM, H.J. Lu wrote:
>>
>> On Fri, Nov 4, 2016 at 12:03 PM, Florian Weimer <fweimer@redhat.com>
>> wrote:
>>>
>>> On 11/04/2016 06:47 PM, H.J. Lu wrote:
>>>>
>>>>
>>>> There is no need to use PLT nor GOT in libc.a to branch to a function,
>>>> regardless whether libc.a is compiled with PIC or not.
>>>>
>>>> Tested on x86-64. OK for master?
>>>
>>>
>>>
>>> Isn't this header file used outside of libc as well?
>>
>>
>> It is used for other .a files. If they aren't used to create static
>> binaries,
>> PLT/GOT may be used. The resulting executable will work correctly.
>
>
> You mean because “name” is automatically mapped to “name@plt”?
No. There is no "@plt". Linker will create a PLT entry if the function
is defined in a shared object.
> I find this comment not very illuminating:
>
> +/* For libc.a, we want to branch to target directly. */
> # define JUMPTARGET(name) name
>
> And cheating the static linker in this way seems like a future maintenance
> hazard.
>
It is ok as long as those static archives aren't used to create shared
objects.
--
H.J.