diff options
author | Rui Ueyama <ruiu@google.com> | 2018-12-19 23:25:02 +0000 |
---|---|---|
committer | Rui Ueyama <ruiu@google.com> | 2018-12-19 23:25:02 +0000 |
commit | 392f0b2b719e4aab73f608924d3b1df25be4ea9c (patch) | |
tree | 2ba4db9902a2d9f4ae14e3c514135067c8602e98 | |
parent | 179064983aa73dd32c3004eac82af220147962e3 (diff) | |
download | bcm5719-llvm-392f0b2b719e4aab73f608924d3b1df25be4ea9c.tar.gz bcm5719-llvm-392f0b2b719e4aab73f608924d3b1df25be4ea9c.zip |
Simplify. NFC.
Differential Revision: https://reviews.llvm.org/D55903
llvm-svn: 349697
-rw-r--r-- | lld/ELF/SymbolTable.cpp | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/lld/ELF/SymbolTable.cpp b/lld/ELF/SymbolTable.cpp index e372461ee3c..8f320a5778b 100644 --- a/lld/ELF/SymbolTable.cpp +++ b/lld/ELF/SymbolTable.cpp @@ -494,18 +494,23 @@ void SymbolTable::addShared(StringRef Name, SharedFile<ELFT> &File, // An undefined symbol with non default visibility must be satisfied // in the same DSO. - if (WasInserted || - ((S->isUndefined() || S->isLazy()) && S->Visibility == STV_DEFAULT)) { + if (WasInserted) { + replaceSymbol<SharedSymbol>(S, File, Name, Sym.getBinding(), Sym.st_other, + Sym.getType(), Sym.st_value, Sym.st_size, + Alignment, VerdefIndex); + return; + } + + if ((S->isUndefined() || S->isLazy()) && S->Visibility == STV_DEFAULT) { uint8_t Binding = S->Binding; bool WasUndefined = S->isUndefined(); replaceSymbol<SharedSymbol>(S, File, Name, Sym.getBinding(), Sym.st_other, Sym.getType(), Sym.st_value, Sym.st_size, Alignment, VerdefIndex); - if (!WasInserted) { - S->Binding = Binding; - if (!S->isWeak() && !Config->GcSections && WasUndefined) - File.IsNeeded = true; - } + + S->Binding = Binding; + if (!S->isWeak() && !Config->GcSections && WasUndefined) + File.IsNeeded = true; } } |