diff --git a/lld/lib/Core/Resolver.cpp b/lld/lib/Core/Resolver.cpp index bb942f54b70a..2f24e47ef8f4 100644 --- a/lld/lib/Core/Resolver.cpp +++ b/lld/lib/Core/Resolver.cpp @@ -125,7 +125,7 @@ bool Resolver::doUndefinedAtom(const UndefinedAtom &atom) { // If the undefined symbol has an alternative name, try to resolve the // symbol with the name to give it a second chance. This feature is used // for COFF "weak external" symbol. - if (!_symbolTable.isDefined(atom.name())) { + if (newUndefAdded || !_symbolTable.isDefined(atom.name())) { if (const UndefinedAtom *fallbackAtom = atom.fallback()) { doUndefinedAtom(*fallbackAtom); _symbolTable.addReplacement(&atom, fallbackAtom);