forked from OSchip/llvm-project
Revert "[lld-macho][nfc] Don't use `stubsHelperIndex` in ICF hash"
This reverts commit 112135e774
.
Breaks lld/test/MachO/{icf.s,cfstring-dedup.s,invalid/cfstring.s}
This commit is contained in:
parent
4133a85c86
commit
d86d431814
|
@ -278,7 +278,9 @@ void ICF::run() {
|
|||
uint32_t hash = isec->icfEqClass[icfPass % 2];
|
||||
for (const Reloc &r : isec->relocs) {
|
||||
if (auto *sym = r.referent.dyn_cast<Symbol *>()) {
|
||||
if (auto *defined = dyn_cast<Defined>(sym)) {
|
||||
if (auto *dylibSym = dyn_cast<DylibSymbol>(sym))
|
||||
hash += dylibSym->stubsHelperIndex;
|
||||
else if (auto *defined = dyn_cast<Defined>(sym)) {
|
||||
if (defined->isec) {
|
||||
if (auto referentIsec =
|
||||
dyn_cast<ConcatInputSection>(defined->isec))
|
||||
|
@ -289,9 +291,8 @@ void ICF::run() {
|
|||
} else {
|
||||
hash += defined->value;
|
||||
}
|
||||
} else if (!isa<Undefined>(sym)) { // ICF runs before Undefined diags
|
||||
} else if (!isa<Undefined>(sym)) // ICF runs before Undefined diags.
|
||||
llvm_unreachable("foldIdenticalSections symbol kind");
|
||||
}
|
||||
}
|
||||
}
|
||||
// Set MSB to 1 to avoid collisions with non-hashed classes.
|
||||
|
|
Loading…
Reference in New Issue