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: [PATCH] PR gold/18609


>>>>> If you remove those changes, won't it generate an unused GOT slot
>>>>> when GOTPCREL relocation is converted to PC-relative relocation?
>>>>
>>>> Yes, it can generate unused GOT slots.
>>>
>>> I think we should add a testcase to check for the unused GOT slot.
>>> Please check if you can implement similar heuristic in gold:
>>>
>>> https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;a=commitdiff;h=59cab532835904f368b0aa99267afba5fda5ded2
>>
>> No addresses available at the time of Target_x86_64<size>::Scan::local
>> and *::global work, so not clear how to use some heuristics here...
>
> There are no addresses available in ld.bfd neither.  An estimate was
> used in ld.bfd.

In gold, I think the best you can do is check to see if the branch and
its target are in the same output section, then use
output_section_offset() plus offset within the input section to check
distance between the two. At the time you're scanning relocations, we
haven't even done a tentative layout of output sections, so you'll
have to be pessimistic if the two aren't in the same output section.

-cary


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