diff --git a/lld/ELF/Relocations.cpp b/lld/ELF/Relocations.cpp index 32fe2f1275b6..42f0a873909b 100644 --- a/lld/ELF/Relocations.cpp +++ b/lld/ELF/Relocations.cpp @@ -697,7 +697,7 @@ static std::vector undefs; static const Symbol *getAlternativeSpelling(const Undefined &sym) { // Build a map of local defined symbols. DenseMap map; - if (sym.file) { + if (sym.file && !isa(sym.file)) { for (const Symbol *s : sym.file->getSymbols()) if (s->isLocal() && s->isDefined()) map.try_emplace(s->getName(), s);