[PATCH] D55903: Simplify. NFC.

Rui Ueyama via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Dec 19 15:28:46 PST 2018


This revision was automatically updated to reflect the committed changes.
Closed by commit rL349697: Simplify. NFC. (authored by ruiu, committed by ).

Changed prior to commit:
  https://reviews.llvm.org/D55903?vs=178969&id=178978#toc

Repository:
  rL LLVM

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D55903/new/

https://reviews.llvm.org/D55903

Files:
  lld/trunk/ELF/SymbolTable.cpp


Index: lld/trunk/ELF/SymbolTable.cpp
===================================================================
--- lld/trunk/ELF/SymbolTable.cpp
+++ lld/trunk/ELF/SymbolTable.cpp
@@ -494,18 +494,23 @@
 
   // 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;
   }
 }
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D55903.178978.patch
Type: text/x-patch
Size: 1300 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20181219/b84ddb7e/attachment.bin>


More information about the llvm-commits mailing list