summaryrefslogtreecommitdiffstats
path: root/lld/lib/Core
diff options
context:
space:
mode:
authorRui Ueyama <ruiu@google.com>2016-02-28 21:59:02 +0000
committerRui Ueyama <ruiu@google.com>2016-02-28 21:59:02 +0000
commitbe5e0b07caa02a527681c6eb3bb64fcfcff862c3 (patch)
treea82483155c24b0f45dea513639c0f707fe689721 /lld/lib/Core
parent8cca07eacf7f1f9f87f2108850abee9eade18f28 (diff)
downloadbcm5719-llvm-be5e0b07caa02a527681c6eb3bb64fcfcff862c3.tar.gz
bcm5719-llvm-be5e0b07caa02a527681c6eb3bb64fcfcff862c3.zip
Remove dead code for ELF.
llvm-svn: 262195
Diffstat (limited to 'lld/lib/Core')
-rw-r--r--lld/lib/Core/LinkingContext.cpp5
-rw-r--r--lld/lib/Core/SymbolTable.cpp56
2 files changed, 11 insertions, 50 deletions
diff --git a/lld/lib/Core/LinkingContext.cpp b/lld/lib/Core/LinkingContext.cpp
index 54d2c51f39a..75baf7ac918 100644
--- a/lld/lib/Core/LinkingContext.cpp
+++ b/lld/lib/Core/LinkingContext.cpp
@@ -16,12 +16,9 @@
namespace lld {
LinkingContext::LinkingContext()
- : _deadStrip(false), _allowDuplicates(false),
- _globalsAreDeadStripRoots(false),
+ : _deadStrip(false), _globalsAreDeadStripRoots(false),
_searchArchivesToOverrideTentativeDefinitions(false),
_searchSharedLibrariesToOverrideTentativeDefinitions(false),
- _warnIfCoalesableAtomsHaveDifferentCanBeNull(false),
- _warnIfCoalesableAtomsHaveDifferentLoadName(false),
_printRemainingUndefines(true), _allowRemainingUndefines(false),
_logInputFiles(false), _allowShlibUndefines(true),
_outputFileType(OutputFileType::Default), _nextOrdinal(0) {}
diff --git a/lld/lib/Core/SymbolTable.cpp b/lld/lib/Core/SymbolTable.cpp
index 99e8547d601..44631a5d40d 100644
--- a/lld/lib/Core/SymbolTable.cpp
+++ b/lld/lib/Core/SymbolTable.cpp
@@ -28,8 +28,6 @@
#include <vector>
namespace lld {
-SymbolTable::SymbolTable(LinkingContext &context) : _ctx(context) {}
-
bool SymbolTable::add(const UndefinedAtom &atom) { return addByName(atom); }
bool SymbolTable::add(const SharedLibraryAtom &atom) { return addByName(atom); }
@@ -166,19 +164,16 @@ bool SymbolTable::addByName(const Atom &newAtom) {
// fallthrough
}
case MCR_Error:
- if (!_ctx.getAllowDuplicates()) {
- llvm::errs() << "Duplicate symbols: "
- << existing->name()
- << ":"
- << existing->file().path()
- << " and "
- << newAtom.name()
- << ":"
- << newAtom.file().path()
- << "\n";
- llvm::report_fatal_error("duplicate symbol error");
- }
- useNew = false;
+ llvm::errs() << "Duplicate symbols: "
+ << existing->name()
+ << ":"
+ << existing->file().path()
+ << " and "
+ << newAtom.name()
+ << ":"
+ << newAtom.file().path()
+ << "\n";
+ llvm::report_fatal_error("duplicate symbol error");
break;
}
break;
@@ -188,14 +183,6 @@ bool SymbolTable::addByName(const Atom &newAtom) {
const UndefinedAtom* newUndef = cast<UndefinedAtom>(&newAtom);
bool sameCanBeNull = (existingUndef->canBeNull() == newUndef->canBeNull());
- if (!sameCanBeNull && _ctx.warnIfCoalesableAtomsHaveDifferentCanBeNull()) {
- llvm::errs() << "lld warning: undefined symbol "
- << existingUndef->name()
- << " has different weakness in "
- << existingUndef->file().path()
- << " and in " << newUndef->file().path() << "\n";
- }
-
if (sameCanBeNull)
useNew = false;
else
@@ -203,26 +190,6 @@ bool SymbolTable::addByName(const Atom &newAtom) {
break;
}
case NCR_DupShLib: {
- const SharedLibraryAtom *curShLib = cast<SharedLibraryAtom>(existing);
- const SharedLibraryAtom *newShLib = cast<SharedLibraryAtom>(&newAtom);
- bool sameNullness =
- (curShLib->canBeNullAtRuntime() == newShLib->canBeNullAtRuntime());
- bool sameName = curShLib->loadName().equals(newShLib->loadName());
- if (sameName && !sameNullness &&
- _ctx.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();
- }
- if (!sameName && _ctx.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();
- }
useNew = false;
break;
}
@@ -232,9 +199,6 @@ bool SymbolTable::addByName(const Atom &newAtom) {
break;
}
- // Give context a chance to change which is kept.
- _ctx.notifySymbolTableCoalesce(existing, &newAtom, useNew);
-
if (useNew) {
// Update name table to use new atom.
_nameTable[name] = &newAtom;
OpenPOWER on IntegriCloud