[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 Nov 17 04:03:33 PST 2020


stefanp added inline comments.


================
Comment at: lld/ELF/SyntheticSections.cpp:710
+    return;
+
+  // Add the size of the header.
----------------
MaskRay wrote:
> Can you use an approach similar to GotPltSection::hasGotPltOffset?
I'm sorry but I'm not sure what you are looking for.
I assume you mean `GotPltSection::hasGotPltOffRel`.

Are you looking to replace 
```
if (config->emachine != EM_PPC64 || ElfSym::globalOffsetTable)
    return;
```
with something like:
```
if (hasGotHeader || ElfSym::globalOffsetTable)
    return;
```
Where I can then set hasGotHeader from the GotSection constructor and/or PPC specific code?

Or:
Should I set `numEntries += target->gotHeaderEntriesNum;` from PPC specific code?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D91426



More information about the llvm-commits mailing list