[PATCH] D112386: [ELF][X86] Support R_X86_64_PLTOFF64

Peter Smith via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Oct 25 10:22:39 PDT 2021


peter.smith added a comment.

FWIW this looks like it matches the description in https://refspecs.linuxbase.org/elf/x86_64-abi-0.99.pdf . Would be good to get this checked over by someone that knows x86_64 better than me. If there's no-one left I can approve.

This may be a naive question, just thinking of Arm/AArch64 where the code often loads the base of the GOT with the __GLOBAL_OFFSET_TABLE__ symbol. It may be worth checking on GOT being .got.plt. I'm guessing that in the large-code model some bit of code loads the base of the .got.plt. Is that done via the __GLOBAL_OFFSET_TABLE__ symbol or some other more direct method? Just thinking of the case where __GLOBAL_OFFSET_TABLE__ is not placed in between .got or .got.plt, this wouldn't be a problem if LLD always placed __GLOBAL_OFFSET_TABLE__ at the base of the .got.plt if it existed. No problems if there is a more direct method for the code to get the base of the .got.plt.



================
Comment at: lld/ELF/Relocations.cpp:1401
   //
   // The 4 types that relative GOTPLT are all x86 and x86-64 specific.
+  if (oneof<R_GOTPLTONLY_PC, R_GOTPLTREL, R_GOTPLT, R_PLT_GOTPLT,
----------------
// The 5 types ?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D112386



More information about the llvm-commits mailing list