[PATCH] D70937: [ELF][PPC64] Support long branch thunks with addends

Sean Fertile via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Dec 5 08:11:22 PST 2019


sfertile accepted this revision.
sfertile added a comment.
This revision is now accepted and ready to land.

I have a couple minor questions, but it LGTM.

Should there be an error when an addend is used and the call target is a function symbol with a non-zero offset between global and local entries?



================
Comment at: lld/ELF/Relocations.cpp:511
   sym.gotIndex = old.gotIndex;
   sym.verdefIndex = old.verdefIndex;
   sym.exportDynamic = true;
----------------
On trunk I still see `sym.ppc64BranchltIndex = old.ppc64BranchltIndex;` here. I take it deleting that is meant to be part of this patch.


================
Comment at: lld/ELF/SyntheticSections.cpp:3461
     // must be a local-call.
-    write64(buf,
-            sym->getVA() + getPPC64GlobalEntryToLocalEntryOffset(sym->stOther));
+    write64(buf, sym->getVA() + addend +
+                     getPPC64GlobalEntryToLocalEntryOffset(sym->stOther));
----------------
Why `sym->getVA() + addend` as opposed to `sym->getVA(addend)`? 


================
Comment at: lld/test/ELF/ppc64-long-branch-pi.s:86
+
+## Force creation of .got
+.section .data
----------------
Odd, I though we would always create a  .got section with the tocbase as the first entry. And the `ppc64-long-branch.s` doesn't seem to need it.  


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D70937





More information about the llvm-commits mailing list