Skip to content

Commit 0405920

Browse files
committed
Re-land [lld-macho][nfc] Don't use stubsHelperIndex in ICF hash
Previous attempt was commit 112135e and reverted in d86d431.
1 parent 7643633 commit 0405920

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

lld/MachO/ICF.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -278,9 +278,7 @@ void ICF::run() {
278278
uint32_t hash = isec->icfEqClass[icfPass % 2];
279279
for (const Reloc &r : isec->relocs) {
280280
if (auto *sym = r.referent.dyn_cast<Symbol *>()) {
281-
if (auto *dylibSym = dyn_cast<DylibSymbol>(sym))
282-
hash += dylibSym->stubsHelperIndex;
283-
else if (auto *defined = dyn_cast<Defined>(sym)) {
281+
if (auto *defined = dyn_cast<Defined>(sym)) {
284282
if (defined->isec) {
285283
if (auto referentIsec =
286284
dyn_cast<ConcatInputSection>(defined->isec))
@@ -291,8 +289,10 @@ void ICF::run() {
291289
} else {
292290
hash += defined->value;
293291
}
294-
} else if (!isa<Undefined>(sym)) // ICF runs before Undefined diags.
295-
llvm_unreachable("foldIdenticalSections symbol kind");
292+
} else {
293+
// ICF runs before Undefined diags
294+
assert(isa<Undefined>(sym) || isa<DylibSymbol>(sym));
295+
}
296296
}
297297
}
298298
// Set MSB to 1 to avoid collisions with non-hashed classes.

0 commit comments

Comments
 (0)