[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
Wed Mar 20 00:10:24 PDT 2019


sivachandra added a comment.

> Can you quote the paragraph where negative indices into GOT are used in i386/amd64 psABI?

See the paragraph below Figure 5.1 on page 77 of http://refspecs.linuxbase.org/elf/x86_64-abi-0.99.pdf. Quoting here for convenience:

  The symbol _GLOBAL_OFFSET_TABLE_ may reside in the middle of the
  .got section, allowing both negative and non-negative offsets into the array of
  addresses.

Thinking about it, I think I am mixing up things wrt R_X86_64_GOTOFF64. Implementing it as `Sym.getVA(A) - In.GotPlt->getVA()` over this change should just work IMHO. Let me try it tomorrow and get back to you.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D59559/new/

https://reviews.llvm.org/D59559





More information about the llvm-commits mailing list