[PATCH] D83669: [PowerPC] Support for R_PPC64_REL24_NOTOC calls where the caller has no TOC and the callee is not DSO local

Sean Fertile via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jul 13 13:20:15 PDT 2020


sfertile added inline comments.


================
Comment at: lld/ELF/Thunks.cpp:1008
+  if (type == R_PPC64_REL24_NOTOC && s.isInPlt())
+    return make<PPC64R12SetupStub>(s);
+
----------------
I'll need to check what instruction we are using in the R12SetupStub, I see the comment says `pld` right now, but where is it loading from?
`destination.getVA() - getThunkTargetSym()->getVA()` is the offset from the program counter to the (non-premptable) definition so I'm guessing its meant to be a paddi instead. Either way, that offset calculation is wrong for a symbol in the plt.  Instead we  want to load the address of the function from the plt.


================
Comment at: lld/test/ELF/ppc64-pcrel-call-to-extern.s:47
+# CHECK-LABEL: __global_entry_point_setup_callee_global_stother0
+# CHECK:       pld 12
+# CHECK-NEXT:  mtctr 12
----------------
Whats the offset that gets encoded into the instruction?  What offset are you expecting?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D83669





More information about the llvm-commits mailing list