Index: lld/trunk/COFF/ICF.cpp =================================================================== --- lld/trunk/COFF/ICF.cpp +++ lld/trunk/COFF/ICF.cpp @@ -271,7 +271,7 @@ uint32_t Hash = SC->Class[1]; for (Symbol *B : SC->symbols()) if (auto *Sym = dyn_cast_or_null(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); }); Index: lld/trunk/ELF/ICF.cpp =================================================================== --- lld/trunk/ELF/ICF.cpp +++ lld/trunk/ELF/ICF.cpp @@ -431,7 +431,7 @@ Symbol &S = IS->template getFile()->getRelocTargetSym(Rel); if (auto *D = dyn_cast(&S)) if (auto *RelSec = dyn_cast_or_null(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);