diff options
Diffstat (limited to 'lld/lib/Core/Resolver.cpp')
| -rw-r--r-- | lld/lib/Core/Resolver.cpp | 24 |
1 files changed, 13 insertions, 11 deletions
diff --git a/lld/lib/Core/Resolver.cpp b/lld/lib/Core/Resolver.cpp index fa3467c473b..8e94929340f 100644 --- a/lld/lib/Core/Resolver.cpp +++ b/lld/lib/Core/Resolver.cpp @@ -315,17 +315,19 @@ bool Resolver::checkUndefines(bool final) { bool foundUndefines = false; for (const UndefinedAtom *undefAtom : undefinedAtoms) { const File &f = undefAtom->file(); - bool isAtomUndefined = false; - if (isa<SharedLibraryFile>(f)) { - if (!_targetInfo.allowShlibUndefines()) { - foundUndefines = true; - isAtomUndefined = true; - } - } else if (undefAtom->canBeNull() == UndefinedAtom::canBeNullNever) { - foundUndefines = true; - isAtomUndefined = true; - } - if (isAtomUndefined && _targetInfo.printRemainingUndefines()) { + + // Skip over a weak symbol. + if (undefAtom->canBeNull() != UndefinedAtom::canBeNullNever) + continue; + + // If this is a library and undefined symbols are allowed on the + // target platform, skip over it. + if (isa<SharedLibraryFile>(f) && _targetInfo.allowShlibUndefines()) + continue; + + // Seems like this symbol is undefined. Warn that. + foundUndefines = true; + if (_targetInfo.printRemainingUndefines()) { llvm::errs() << "Undefined Symbol: " << undefAtom->file().path() << " : " << undefAtom->name() << "\n"; } |

