Revert "temporary commit."

This reverts commit r205635 that was submitted by mistake.

llvm-svn: 205637
This commit is contained in:
Rui Ueyama 2014-04-04 18:06:56 +00:00
parent 2e3881c0f5
commit fbd6c44e6a
1 changed files with 34 additions and 28 deletions

View File

@ -262,20 +262,24 @@ void SymbolTable::addByName(const Atom &newAtom) {
break; break;
} }
case NCR_DupShLib: { case NCR_DupShLib: {
const SharedLibraryAtom *curShLib = dyn_cast<SharedLibraryAtom>(existing); const SharedLibraryAtom* curShLib =
const SharedLibraryAtom *newShLib = dyn_cast<SharedLibraryAtom>(&newAtom); dyn_cast<SharedLibraryAtom>(existing);
const SharedLibraryAtom* newShLib =
dyn_cast<SharedLibraryAtom>(&newAtom);
assert(curShLib != nullptr); assert(curShLib != nullptr);
assert(newShLib != nullptr); assert(newShLib != nullptr);
bool sameNullness = bool sameNullness = (curShLib->canBeNullAtRuntime()
(curShLib->canBeNullAtRuntime() == newShLib->canBeNullAtRuntime()); == newShLib->canBeNullAtRuntime());
bool sameName = curShLib->loadName().equals(newShLib->loadName()); bool sameName = curShLib->loadName().equals(newShLib->loadName());
if (!sameName) { if (!sameName) {
useNew = false; useNew = false;
if (_context.warnIfCoalesableAtomsHaveDifferentLoadName()) { if (_context.warnIfCoalesableAtomsHaveDifferentLoadName()) {
// FIXME: need diagonstics interface for writing warning messages // FIXME: need diagonstics interface for writing warning messages
llvm::errs() << "lld warning: shared library symbol " llvm::errs() << "lld warning: shared library symbol "
<< curShLib->name() << " has different load path in " << curShLib->name()
<< curShLib->file().path() << " and in " << " has different load path in "
<< curShLib->file().path()
<< " and in "
<< newShLib->file().path(); << newShLib->file().path();
} }
} else if (!sameNullness) { } else if (!sameNullness) {
@ -283,16 +287,18 @@ void SymbolTable::addByName(const Atom &newAtom) {
if (_context.warnIfCoalesableAtomsHaveDifferentCanBeNull()) { if (_context.warnIfCoalesableAtomsHaveDifferentCanBeNull()) {
// FIXME: need diagonstics interface for writing warning messages // FIXME: need diagonstics interface for writing warning messages
llvm::errs() << "lld warning: shared library symbol " llvm::errs() << "lld warning: shared library symbol "
<< curShLib->name() << " has different weakness in " << curShLib->name()
<< curShLib->file().path() << " and in " << " has different weakness in "
<< curShLib->file().path()
<< " and in "
<< newShLib->file().path(); << newShLib->file().path();
} }
} else { } else {
// Both shlib atoms are identical and can be coalesced. // Both shlib atoms are identical and can be coalesced.
useNew = false; useNew = false;
} }
break;
} }
break;
case NCR_Error: case NCR_Error:
llvm::errs() << "SymbolTable: error while merging " << name << "\n"; llvm::errs() << "SymbolTable: error while merging " << name << "\n";
llvm::report_fatal_error("duplicate symbol error"); llvm::report_fatal_error("duplicate symbol error");