[PATCH] D25560: [ELF] Emit relocation for GOT entry even if it is an absolute symbol

Eugene Leviant via llvm-commits llvm-commits at lists.llvm.org
Thu Oct 27 01:42:33 PDT 2016


> The entry in the got should always contain 42, not 42 + load address, no?

Looks like it shouldn't. Just try running the same test case
(abs-hidden.s) using ld.bfd and ld.gold.
Interesting fact is that ld.bfd emits two relative relocs: one for
.got and one for .text.

2016-10-27 1:23 GMT+03:00 Rafael EspĂ­ndola <rafael.espindola at gmail.com>:
> It is hard to see this as being the correct behaviour.
>
> R_X86_64_RELATIVE is supposed to be load address + addend.
>
> Given the
>
>  .long foo at gotpcrel
>
> The entry in the got should always contain 42, not 42 + load address, no?
>
> Cheers,
> Rafael
>
>
>
>
> On 26 October 2016 at 18:06, Rafael EspĂ­ndola
> <rafael.espindola at gmail.com> wrote:
>> looking
>>
>> On 25 October 2016 at 09:24, Eugene Leviant <evgeny.leviant at gmail.com> wrote:
>>> evgeny777 added a comment.
>>>
>>> Ping
>>>
>>>
>>> Repository:
>>>   rL LLVM
>>>
>>> https://reviews.llvm.org/D25560
>>>
>>>
>>>


More information about the llvm-commits mailing list