summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lld/COFF/ICF.cpp2
-rw-r--r--lld/ELF/ICF.cpp2
2 files changed, 2 insertions, 2 deletions
diff --git a/lld/COFF/ICF.cpp b/lld/COFF/ICF.cpp
index 84709de2a6f..88e67443c26 100644
--- a/lld/COFF/ICF.cpp
+++ b/lld/COFF/ICF.cpp
@@ -271,7 +271,7 @@ void ICF::run(ArrayRef<Chunk *> Vec) {
uint32_t Hash = SC->Class[1];
for (Symbol *B : SC->symbols())
if (auto *Sym = dyn_cast_or_null<DefinedRegular>(B))
- Hash ^= Sym->getChunk()->Class[1];
+ Hash += Sym->getChunk()->Class[1];
// Set MSB to 1 to avoid collisions with non-hash classs.
SC->Class[0] = Hash | (1U << 31);
});
diff --git a/lld/ELF/ICF.cpp b/lld/ELF/ICF.cpp
index 14dbd4e122c..3f326fa337b 100644
--- a/lld/ELF/ICF.cpp
+++ b/lld/ELF/ICF.cpp
@@ -431,7 +431,7 @@ static void combineRelocHashes(InputSection *IS, ArrayRef<RelTy> Rels) {
Symbol &S = IS->template getFile<ELFT>()->getRelocTargetSym(Rel);
if (auto *D = dyn_cast<Defined>(&S))
if (auto *RelSec = dyn_cast_or_null<InputSection>(D->Section))
- Hash ^= RelSec->Class[1];
+ Hash += RelSec->Class[1];
}
// Set MSB to 1 to avoid collisions with non-hash IDs.
IS->Class[0] = Hash | (1U << 31);
OpenPOWER on IntegriCloud