[PATCH][x86_64] Convert indirect call via GOT to direct when possible
H.J. Lu
hjl.tools@gmail.com
Tue Jun 28 20:58:00 GMT 2016
On Tue, Jun 28, 2016 at 12:31 PM, Cary Coutant <ccoutant@gmail.com> wrote:
>> Yes, good point. I am a little confused about this new relocation
>> elfcpp::R_X86_64_GOTPCRELX. I have attached a patch that reverts to
>> the change you suggested where I check for conversion always.
>> However, is it safe to assume that a elfcpp::R_X86_64_GOTPCRELX
>> relocation implies that the instruction containing the relocation is
>> eligible for one of the conversions *always* ?
>
> Here's HJ's original proposal:
>
> https://groups.google.com/forum/#!topic/x86-64-abi/n9AWHogmVY0
>
> It looks like that relocation marks several different instructions
> sequences that are eligible for transformation, so it looks like you
> may still have to look at the opcode. But it might be the case that in
> Scan::global(), all we need to know is that *some* transformation is
> going to happen that will remove the need for the GOT entry -- it
> doesn't really matter which one.
>
> HJ, can you clarify? If we have a GOTPCRELX relocation, what other
> conditions are sufficient to guarantee that one of the proposed
> translations will take place during relocation?
>
All GOTPCRELX relocations can be converted if symbol is resolved
locally without relocation overflow.
--
H.J.
More information about the Binutils
mailing list