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:
>> The case where Symbol::needs_dynamic_reloc() _does_ need to describe
>> the GOT entry itself is for the current definition of use_plt_offset().
>> That function is called for all relocations (including GOT relocations)
>> at the beginning of the target's relocate() function. ÂIn the case of
>> GOT relocs, use_plt_offset() says whether the _GOT entry_ should be
>> redirected to the PLT. Â(This is of course sometimes true for ifuncs,
>> but should never be true otherwise.) ÂSo I claim that, in the context
>> of use_plt_offset(), needs_dynamic_reloc() really is telling you about
>> the GOT entry rather than the GOT reloc itself.
>
> We never call Symbol::use_plt_offset() when relocating a GOT entry. I
> think you're confusing that with the use_plt_offset_ flag in the
> Got_entry.

No.  What I meant was: we call Symbol::use_plt_offset() for all GOT
_relocations_.  At that stage, we're trying to work out what value the
relocation symbol resolves to, and in the case of GOT relocations,
that symbol value is the value that should be stored in the GOT _entry_.
The relocation-specific handling will then convert that (modified)
symbol value into a GOT offset.

So when we call Symbol::use_plt_offset() for GOT _relocations_,
it is effectively telling us whether the GOT _entry_ should be
directed to the PLT.    Symbol::use_plt_offset() calls
Symbol::needs_dynamic_reloc(), so in this case,
Symbol::needs_dynamic_reloc() is also telling us about the GOT entry.

Richard


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