[PATCH] D59559: [ELF] Make R_I386_GOTPC and R_X86_64_GOTPC32/64 resolve to .got.plt.

Siva Chandra via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Mar 19 13:48:09 PDT 2019


sivachandra created this revision.
sivachandra added a reviewer: ruiu.
Herald added subscribers: llvm-commits, MaskRay, arichardson, emaste.
Herald added a reviewer: espindola.
Herald added a project: LLVM.

These relocations are typically used to refer to the symbol
_GLOBAL_OFFSET_TABLE_. Since this symbol is at the beginning of
.got.plt, these relocations should resolve to .got.plt afterall.
This matches the behavior of ld.bfd and ld.gold.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D59559

Files:
  lld/ELF/Arch/X86.cpp
  lld/ELF/Arch/X86_64.cpp
  lld/ELF/InputSection.cpp
  lld/ELF/Relocations.cpp
  lld/ELF/Relocations.h
  lld/test/ELF/i386-gotpc-dynamic.s
  lld/test/ELF/i386-gotpc.s
  lld/test/ELF/relocation-i686.s
  lld/test/ELF/x86-64-reloc-gotoff64.s
  lld/test/ELF/x86-64-reloc-gotpc64.s

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D59559.191388.patch
Type: text/x-patch
Size: 6170 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190319/5c78fcfa/attachment.bin>


More information about the llvm-commits mailing list