diff --git a/lld/lib/Core/Resolver.cpp b/lld/lib/Core/Resolver.cpp index 1c200f9dec08..863b36db2e05 100644 --- a/lld/lib/Core/Resolver.cpp +++ b/lld/lib/Core/Resolver.cpp @@ -475,12 +475,12 @@ bool Resolver::resolve() { this->deadStripOptimize(); if (this->checkUndefines(false)) { if (!_context.allowRemainingUndefines()) - return true; + return false; } this->removeCoalescedAwayAtoms(); this->linkTimeOptimize(); this->_result.addAtoms(_atoms); - return false; + return true; } void Resolver::MergedFile::addAtom(const Atom& atom) { diff --git a/lld/lib/Driver/Driver.cpp b/lld/lib/Driver/Driver.cpp index dd744e133660..6fdb34399fe6 100644 --- a/lld/lib/Driver/Driver.cpp +++ b/lld/lib/Driver/Driver.cpp @@ -107,7 +107,7 @@ bool Driver::link(LinkingContext &context, raw_ostream &diagnostics) { // Do core linking. ScopedTask resolveTask(getDefaultDomain(), "Resolve"); Resolver resolver(context); - if (resolver.resolve()) { + if (!resolver.resolve()) { if (!context.allowRemainingUndefines()) return false; }