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

Fangrui Song via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Nov 18 14:14:56 PST 2020


MaskRay added inline comments.


================
Comment at: lld/ELF/SyntheticSections.cpp:710
+    return;
+
+  // Add the size of the header.
----------------
stefanp wrote:
> 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?
We should drop `setupPPCDelayedInit` and compute the size of GotSection with an approach similar to `GotPltSection::hasGotPltOffset`


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