diff options
author | Rui Ueyama <ruiu@google.com> | 2014-04-04 18:01:52 +0000 |
---|---|---|
committer | Rui Ueyama <ruiu@google.com> | 2014-04-04 18:01:52 +0000 |
commit | 770305804f4620a83ec0ac8c96f6e1fbded08be3 (patch) | |
tree | e6bada8b1490bf3a83d313bf3fbef41e155aaff5 /lld/lib/Core/SymbolTable.cpp | |
parent | 7ec287cda334d27e196b52248e88789030396ce2 (diff) | |
download | bcm5719-llvm-770305804f4620a83ec0ac8c96f6e1fbded08be3.tar.gz bcm5719-llvm-770305804f4620a83ec0ac8c96f6e1fbded08be3.zip |
temporary commit.
llvm-svn: 205635
Diffstat (limited to 'lld/lib/Core/SymbolTable.cpp')
-rw-r--r-- | lld/lib/Core/SymbolTable.cpp | 62 |
1 files changed, 28 insertions, 34 deletions
diff --git a/lld/lib/Core/SymbolTable.cpp b/lld/lib/Core/SymbolTable.cpp index 97181f70468..475c71efefe 100644 --- a/lld/lib/Core/SymbolTable.cpp +++ b/lld/lib/Core/SymbolTable.cpp @@ -262,43 +262,37 @@ void SymbolTable::addByName(const Atom &newAtom) { break; } case NCR_DupShLib: { - const SharedLibraryAtom* curShLib = - dyn_cast<SharedLibraryAtom>(existing); - const SharedLibraryAtom* newShLib = - dyn_cast<SharedLibraryAtom>(&newAtom); - assert(curShLib != nullptr); - assert(newShLib != nullptr); - bool sameNullness = (curShLib->canBeNullAtRuntime() - == newShLib->canBeNullAtRuntime()); - bool sameName = curShLib->loadName().equals(newShLib->loadName()); - if (!sameName) { - useNew = false; - if (_context.warnIfCoalesableAtomsHaveDifferentLoadName()) { - // FIXME: need diagonstics interface for writing warning messages - llvm::errs() << "lld warning: shared library symbol " - << curShLib->name() - << " has different load path in " - << curShLib->file().path() - << " and in " - << newShLib->file().path(); - } - } else if (!sameNullness) { - useNew = false; - if (_context.warnIfCoalesableAtomsHaveDifferentCanBeNull()) { - // FIXME: need diagonstics interface for writing warning messages - llvm::errs() << "lld warning: shared library symbol " - << curShLib->name() - << " has different weakness in " - << curShLib->file().path() - << " and in " - << newShLib->file().path(); - } - } else { - // Both shlib atoms are identical and can be coalesced. - useNew = false; + const SharedLibraryAtom *curShLib = dyn_cast<SharedLibraryAtom>(existing); + const SharedLibraryAtom *newShLib = dyn_cast<SharedLibraryAtom>(&newAtom); + assert(curShLib != nullptr); + assert(newShLib != nullptr); + bool sameNullness = + (curShLib->canBeNullAtRuntime() == newShLib->canBeNullAtRuntime()); + bool sameName = curShLib->loadName().equals(newShLib->loadName()); + if (!sameName) { + useNew = false; + if (_context.warnIfCoalesableAtomsHaveDifferentLoadName()) { + // FIXME: need diagonstics interface for writing warning messages + llvm::errs() << "lld warning: shared library symbol " + << curShLib->name() << " has different load path in " + << curShLib->file().path() << " and in " + << newShLib->file().path(); + } + } else if (!sameNullness) { + useNew = false; + if (_context.warnIfCoalesableAtomsHaveDifferentCanBeNull()) { + // FIXME: need diagonstics interface for writing warning messages + llvm::errs() << "lld warning: shared library symbol " + << curShLib->name() << " has different weakness in " + << curShLib->file().path() << " and in " + << newShLib->file().path(); } + } else { + // Both shlib atoms are identical and can be coalesced. + useNew = false; } break; + } case NCR_Error: llvm::errs() << "SymbolTable: error while merging " << name << "\n"; llvm::report_fatal_error("duplicate symbol error"); |