[ELF][PPC64] Don't copy ppc64BranchltIndex in replaceWithDefined
authorFangrui Song <maskray@google.com>
Mon, 2 Dec 2019 23:31:11 +0000 (15:31 -0800)
committerFangrui Song <maskray@google.com>
Thu, 5 Dec 2019 17:33:30 +0000 (09:33 -0800)
replaceWithDefined is used by canonical PLT and copy relocations, which
imply that the symbol is preemptable. ppc64BranchltIndex is only used by
non-preemptable cases, and it can only be the default value in
replaceWithDefined.

lld/ELF/Relocations.cpp

index ea30662..2c020be 100644 (file)
@@ -509,7 +509,6 @@ static void replaceWithDefined(Symbol &sym, SectionBase *sec, uint64_t value,
   sym.pltIndex = old.pltIndex;
   sym.gotIndex = old.gotIndex;
   sym.verdefIndex = old.verdefIndex;
-  sym.ppc64BranchltIndex = old.ppc64BranchltIndex;
   sym.exportDynamic = true;
   sym.isUsedInRegularObj = true;
 }