[PATCH] D114656: [ELF][PPC64] Remove unneeded PPC64PCRelLongBranchThunk

Nemanja Ivanovic via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Nov 29 07:05:28 PST 2021


nemanjai added a comment.

How important is it for the thunk symbol names to match `ld.bfd/ld.gold`?



================
Comment at: lld/ELF/Thunks.cpp:985
 void PPC64R12SetupStub::addSymbols(ThunkSection &isec) {
-  addSymbol(saver.save("__gep_setup_" + destination.getName()), STT_FUNC, 0,
-            isec);
+  addSymbol(saver.save("__long_branch_pcrel_" + destination.getName()),
+            STT_FUNC, 0, isec);
----------------
I am really not a fan of the name. The reason we emit this has nothing to do with long branches and the code we emit is not necessarily PC-Relative.

We emit this thunk when we need to branch to a GEP (Global Entry Point) of local function `Function1` simply because the caller doesn't maintain a TOC pointer and `Function1` does.

The existing name makes sense because the GEP assumes that `r12` contains the address of the GEP itself (i.e. at the first instruction in the GEP, `r12 == pc`).


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D114656



More information about the llvm-commits mailing list