$OpenBSD: patch-tools_lld_ELF_SyntheticSections_cpp,v 1.16 2020/11/18 21:20:00 jca Exp $

- Always allocate GOT header entries on powerpc.
- Do not reserve PowerPC GOT header entries when creating a relocatable object file.

Index: tools/lld/ELF/SyntheticSections.cpp
--- tools/lld/ELF/SyntheticSections.cpp.orig
+++ tools/lld/ELF/SyntheticSections.cpp
@@ -604,6 +604,8 @@ GotSection::GotSection()
   // ElfSym::globalOffsetTable.
   if (ElfSym::globalOffsetTable && !target->gotBaseSymInGotPlt)
     numEntries += target->gotHeaderEntriesNum;
+  else if (config->emachine == EM_PPC && !config->relocatable)
+    numEntries += target->gotHeaderEntriesNum;
 }
 
 void GotSection::addEntry(Symbol &sym) {
