[PATCH] D91426: [PowerPC] Fix issue where binary uses a .got but is missing a .TOC.

Stefan Pintilie via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Mar 30 06:42:15 PDT 2021


stefanp updated this revision to Diff 334141.
stefanp added a comment.

Updated to always add the header to the got on PPC64.

If the .got only contains the header it is not needed and so old linking
behaviour will remain the same.

I was not able to add the .TOC. symbol to the patch. Adding the symbol in the
constructor did no allow me remove it later and adding it to either
finalizeContents or isNeeded is too late and it won't appear in the symbol table
in the object that is linked.

However, I do not believe that the symbol is necessary to fix the bug. Even
without the symbol the .got has space for the .TOC. at the top.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D91426

Files:
  lld/ELF/SyntheticSections.cpp
  lld/test/ELF/ppc64-check-missing-tocbase.s
  lld/test/ELF/ppc64-ld-got-dtprel.s
  lld/test/ELF/ppc64-reloc-got-pcrel34.s
  lld/test/ELF/ppc64-tls-gd.s
  lld/test/ELF/ppc64-tls-ie.s
  lld/test/ELF/ppc64-tls-missing-gdld.s
  lld/test/ELF/ppc64-tls-pcrel-gd.s
  lld/test/ELF/ppc64-tls-pcrel-ie.s

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D91426.334141.patch
Type: text/x-patch
Size: 17548 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210330/cf985e01/attachment.bin>


More information about the llvm-commits mailing list