[PATCH] D82816: [LLD][PowerPC] Implement R_PPC64_REL24_NOTOC calls, callee also has no TOC.

Victor Huang via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jun 29 15:32:32 PDT 2020


NeHuang created this revision.
NeHuang added reviewers: nemanjai, sfertile, stefanp, hfinkel, power-llvm-team.
NeHuang added a project: LLVM.
Herald added subscribers: llvm-commits, shchenz, MaskRay, arichardson, emaste.
Herald added a reviewer: espindola.
Herald added a reviewer: MaskRay.

The PC Relative code allows for calls that are marked with the relocation `R_PPC64_REL24_NOTOC`. This indicates that the caller does not have a valid TOC pointer in `R2` and does not require `R2` to be restored after the call.

This patch is added to support calls to callees that also do not have a TOC and will cover the following situations:

- Local call in same compilation unit, callee with `st_other=0`
- Local call in same compilation unit, callee with `st_other=1`
- Extern call that is DSO local, callee has `st_other=0`
- Extern call that is DSO local, callee has `st_other=1`


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D82816

Files:
  lld/ELF/Arch/PPC64.cpp
  lld/ELF/Thunks.cpp
  lld/test/ELF/ppc64-reloc-rel24notoc-externcall-samedso-callee-st-other0.s
  lld/test/ELF/ppc64-reloc-rel24notoc-externcall-samedso-callee-st-other1.s
  lld/test/ELF/ppc64-reloc-rel24notoc-localcall-callee-st-other0.s
  lld/test/ELF/ppc64-reloc-rel24notoc-localcall-callee-st-other1.s

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D82816.274257.patch
Type: text/x-patch
Size: 11579 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200629/e995c325/attachment.bin>


More information about the llvm-commits mailing list