[PATCH] D30699: [ELF] - Stop producing broken output for R_386_GOT32X relocation.

Rafael EspĂ­ndola via llvm-commits llvm-commits at lists.llvm.org
Thu Mar 30 14:36:14 PDT 2017


>> So looks like it is computing G + A - GOT.
>>
>
> Relocate
>
> mov _start at GOT, %eax
>
> as G + A - GOT leads to random results.  Since compiler never generates
> such sequence before, it never caused the real problem.  The updated
> i386 psABI changes it to G + A so that it can be used to access GOT
> without base register when PIC is off.  Ld in binutils 2.28 generates:

OK, so the ABI definition was changed. An older version required G + A
- GOT, correct?

> 08048074 <_start>:
>  8048074: c7 c0 74 80 04 08     mov    $0x8048074,%eax
>
> as the GOT entry for _start contains the address of _start.

Even with trunk I get

08048094 <_start>:
 8048094:       a1 fc ff ff ff          mov    0xfffffffc,%eax

So maybe it regressed?

Cheers,
Rafael
-------------- next part --------------
A non-text attachment was scrubbed...
Name: non-pic.o
Type: application/octet-stream
Size: 336 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170330/e1bb4d1c/attachment.o>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: start.o
Type: application/octet-stream
Size: 276 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170330/e1bb4d1c/attachment-0001.o>


More information about the llvm-commits mailing list