[PATCH] D55958: [ELF] Simplify addShared. NFC
Fangrui Song via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Dec 20 14:59:48 PST 2018
MaskRay updated this revision to Diff 179169.
MaskRay added a reviewer: ruiu.
MaskRay added a comment.
.
Repository:
rLLD LLVM Linker
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D55958/new/
https://reviews.llvm.org/D55958
Files:
ELF/SymbolTable.cpp
Index: ELF/SymbolTable.cpp
===================================================================
--- ELF/SymbolTable.cpp
+++ ELF/SymbolTable.cpp
@@ -494,20 +494,12 @@
// An undefined symbol with non default visibility must be satisfied
// in the same DSO.
- if (WasInserted) {
- replaceSymbol<SharedSymbol>(S, File, Name, Sym.getBinding(), Sym.st_other,
+ uint8_t Binding = WasInserted ? Sym.getBinding() : S->Binding;
+ if (WasInserted ||
+ ((S->isUndefined() || S->isLazy()) && S->Visibility == STV_DEFAULT)) {
+ replaceSymbol<SharedSymbol>(S, File, Name, Binding, 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;
- replaceSymbol<SharedSymbol>(S, File, Name, Sym.getBinding(), Sym.st_other,
- Sym.getType(), Sym.st_value, Sym.st_size,
- Alignment, VerdefIndex);
-
- S->Binding = Binding;
}
}
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D55958.179169.patch
Type: text/x-patch
Size: 1117 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20181220/a61377af/attachment.bin>
More information about the llvm-commits
mailing list