This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: What is R_X86_64_GOTPLT64 used for?
- From: "H.J. Lu" <hjl dot tools at gmail dot com>
- To: Michael Matz <matz at suse dot de>
- Cc: "x86-64-abi at googlegroups dot com" <x86-64-abi at googlegroups dot com>, GCC Development <gcc at gcc dot gnu dot org>, Binutils <binutils at sourceware dot org>, GNU C Library <libc-alpha at sourceware dot org>
- Date: Wed, 19 Nov 2014 15:54:54 -0800
- Subject: Re: What is R_X86_64_GOTPLT64 used for?
- Authentication-results: sourceware.org; auth=none
- References: <CAMe9rOqb0g2asAe6UZ0hxh8jFf-+eBiaez0pLrPjd0oqVdP0Rg at mail dot gmail dot com> <alpine dot LNX dot 2 dot 00 dot 1411131717220 dot 405 at wotan dot suse dot de> <CAMe9rOrTg=YtVZ1EqN7ha8qUPSXzms20eMU51txVAmL3+cUsQQ at mail dot gmail dot com> <CAMe9rOrnQRo3XXowAEcd_h=i_i5v04=i=kLWjm2ANduv8MwhYQ at mail dot gmail dot com> <alpine dot LNX dot 2 dot 00 dot 1411171425020 dot 405 at wotan dot suse dot de> <CAMe9rOppfTEwtRROsAhFf+7tFjv7pRZ8qho-3NOC7BxvfSBaKg at mail dot gmail dot com>
On Wed, Nov 19, 2014 at 8:38 AM, H.J. Lu <hjl.tools@gmail.com> wrote:
>
> One way to optimize it is to make PLT entry to use the normal GOT
> slot:
>
> jmp *name@GOTPCREL(%rip)
> 8 byte nop
>
> where name@GOTPCREL points to the normal GOT slot
> updated by R_X86_64_GLOB_DAT relocation at run-time.
> Should I give it a try?
I turned out that we can reuse BND PLT. I implemented it in BFD ld
on hjl/plt.got branch:
https://sourceware.org/git/?p=binutils-gdb.git;a=shortlog;h=refs/heads/hjl/plt.got
I tested it on glibc and it works. It should work with all models. Please
give it a try.
--
H.J.