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


>>> 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.
>
> Er, that was "right" to the last bit. ?R_X86_64_GOTPLT64 is a GOT offset,
> isn't it? ?That's GP-relative rather than absolute.

Right, as are GOT32 and GOT64. For the purposes of
relocation_strategy, GP-relative is as good as pc-relative (no dynamic
relocation required). Now I'm wondering why my patch works at all -- I
think we'll need some additional test cases.

> 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.

Are you sure? It looks to me like Symbol::needs_dynamic_reloc()
assumes that ABSOLUTE_REF describes the location being relocated
rather than the GOT entry that is created as a by-product.

-cary


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