[llvm] r267378 - [Support/ELFRelocs] Add R_386_GOT32X.

H.J. Lu via llvm-commits llvm-commits at lists.llvm.org
Mon Apr 25 11:57:59 PDT 2016


On Mon, Apr 25, 2016 at 11:42 AM, Davide Italiano <davide at freebsd.org> wrote:
> On Mon, Apr 25, 2016 at 10:39 AM, H.J. Lu <hjl.tools at gmail.com> wrote:
>> On Mon, Apr 25, 2016 at 10:19 AM, Davide Italiano via llvm-commits
>> <llvm-commits at lists.llvm.org> wrote:
>>> On Mon, Apr 25, 2016 at 10:10 AM, Rafael EspĂ­ndola
>>> <rafael.espindola at gmail.com> wrote:
>>>>> +ELF_RELOC(R_386_GOT32X,         43)
>>>>> +ELF_RELOC(R_386_NUM,            44)
>>>>
>>>> We don't have a _NUM for the other architectures. We should probably
>>>> delete this one.
>>>>
>>>> Cheers,
>>>> Rafael
>>>
>>> r267428
>>>
>>> Thanks!
>>
>> FYI, linker optimization section has been updated in i386 psABI:
>>
>> https://github.com/hjl-tools/x86-psABI/wiki/intel386-psABI-draft.pdf
>>
>> and x86-64 psABI:
>>
>> https://github.com/hjl-tools/x86-psABI/wiki/x86-64-psABI-r252.pdf
>>
>> The updated optimization has been implemented in BFD linker on
>> master branch.
>>
>> --
>> H.J.
>
>
> Thanks H.J.,I plan to implement the optimizations for GOTPC32X (and
> GOTPCRELX) hopefully this week.

GOTPC32X is relatively easy to optimize.  But GOTPCRELX is more
complex.  A couple things you need to keep in mind:

1. Some encodings take R_X86_64_32,  some take R_X86_64_32S
and some take R_X86_64_PC32.  You need to avoid relocation overflow.
2. It may be hard to tell if a relocation will overflow when performing
optimization.  You may need to estimate.
3. You may need to edit the REX byte when converting to a different
encoding.


-- 
H.J.


More information about the llvm-commits mailing list