This is the mail archive of the
mailing list for the binutils project.
Re: [PATCH][x86_64] Convert indirect call via GOT to direct when possible
- From: "H.J. Lu" <hjl dot tools at gmail dot com>
- To: Cary Coutant <ccoutant at gmail dot com>
- Cc: Sriraman Tallam <tmsriram at google dot com>, binutils <binutils at sourceware dot org>, David Li <davidxl at google dot com>
- Date: Fri, 10 Jun 2016 16:18:21 -0700
- Subject: Re: [PATCH][x86_64] Convert indirect call via GOT to direct when possible
- Authentication-results: sourceware.org; auth=none
- References: <CAAs8HmxxdBpS7w8udZgK0QFi5TnenU3wGhpPfhWeKE8Tr=thvA at mail dot gmail dot com> <CAMe9rOpk3aOK5mMkKvYQyzeQxJ-h8o+3KjLRikKSkLmMfqoUtg at mail dot gmail dot com> <CAAs8Hmw2KQ2neDNP5cnQPBVBZMJthvQGTARPiwa-NfAx5R6ugw at mail dot gmail dot com> <CAMe9rOrOyYv0+svcObyaBcoYbAWZTadEPm-mAGQUFFyNjPgctg at mail dot gmail dot com> <CAAs8HmzoxWe2YpvjviV-bs2BRotGa_WFWbCyyLh-_L=s00yxjQ at mail dot gmail dot com> <CAJimCsF4h+e_Ey-fGxPXM0h8ZJ-SmSzyP9XoYaNuEOByJSm=1A at mail dot gmail dot com> <CAMe9rOqzec-Nfi7BoJwkKacwOtZ3Vxb13HS9isqMgqbUKwxSFQ at mail dot gmail dot com> <CAJimCsHM_xHjGdabuz=TvOMzSvPN==8OCzNATnzEBNOWkU0hEg at mail dot gmail dot com>
On Fri, Jun 10, 2016 at 3:22 PM, Cary Coutant <email@example.com> wrote:
>>> 2. HJ, given an R_X86_64_GOTPCRELX relocation, is it still necessary
>>> to check the opcode during Scan::global()? Doesn't the relocation
>>> guarantee that it's an appropriate instruction for the transformation?
>>> I think in both cases, we could skip fetching the section contents if
>>> we have this relocation.
>> Doesn't gold make different decision based on opcode, like
>> branch vs non-branch?
> Only during actual relocation, when we necessarily have the section
> contents already available. During relocation scanning, it would be
> nice to avoid reading the section contents.
Yes, no need to check opcode for GOTPCRELX during scan.