This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [RFC] [gold] Simplify relocation strategy logic


Cary Coutant <ccoutant@google.com> writes:
>> I don't believe this is correct. ÂABSOLUTE_REF is defined as:
>>
>> Â Â// A reference to the symbol's absolute address. ÂThis includes
>> Â Â// references that cause an absolute address to be stored in the GOT.
>> Â ÂABSOLUTE_REF = 1,
>>
>> and the final symbol reference (by the GOT entry) is absolute
>> in all these cases. Â("Absolute in GOT" was supposed to mean
>> "an absolute reference _in_ the global offset table", not "to".)
>> Whether the reference to the GOT entry itself is absolute, relative
>> to the GP, or relative to the PC, isn't modelled by these flags.
>>
>> Does the patch rely on this, or was it just something you noticed
>> by inspection?
>
> My understanding of the ABI is that R_X86_64_GOTPCREL is a pc-relative
> relocation to the GOT entry, and R_X86_64_GOTPLT64 is an absolute
> reference to a GOT entry. In both cases, I believe the GOT entry
> itself is expected to contain an absolute address.

Right.

> I rely on these flags modeling the reference to the GOT entry, not the
> GOT entry itself,

In that case, you're changing the meaning of the flags, so I think
you'll need to adjust all other ports as well the comment.  The current
code really was written to the current definition of ABSOLUTE_REF.

Richard


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]