[lld] 954aaf7 - [ELF] Demote all lazy symbols. NFC

Fangrui Song via llvm-commits llvm-commits at lists.llvm.org
Wed Jan 5 10:24:33 PST 2022


Author: Fangrui Song
Date: 2022-01-05T10:24:29-08:00
New Revision: 954aaf7c1449e4a3a55345532da98fe3ec8710fa

URL: https://github.com/llvm/llvm-project/commit/954aaf7c1449e4a3a55345532da98fe3ec8710fa
DIFF: https://github.com/llvm/llvm-project/commit/954aaf7c1449e4a3a55345532da98fe3ec8710fa.diff

LOG: [ELF] Demote all lazy symbols. NFC

This complements D111365.

D111365 did not demote isUsedInRegularObj lazy symbols just to work around
a --symbol-ordering-file diagnostic quirk.

The quirk was dropped by 00dd2d15a40b0fe9916bb55a48f264498d8fe910,
so we can demote all lazy symbols now, not just the isUsedInRegularObj ones.

Added: 
    

Modified: 
    lld/ELF/Driver.cpp

Removed: 
    


################################################################################
diff  --git a/lld/ELF/Driver.cpp b/lld/ELF/Driver.cpp
index 505602f7da62..e93f83906d52 100644
--- a/lld/ELF/Driver.cpp
+++ b/lld/ELF/Driver.cpp
@@ -1850,8 +1850,7 @@ static void demoteSharedSymbols() {
   llvm::TimeTraceScope timeScope("Demote shared symbols");
   for (Symbol *sym : symtab->symbols()) {
     auto *s = dyn_cast<SharedSymbol>(sym);
-    if (!((s && !s->getFile().isNeeded) ||
-          (sym->isLazy() && sym->isUsedInRegularObj)))
+    if (!(s && !s->getFile().isNeeded) && !sym->isLazy())
       continue;
 
     bool used = sym->used;


        


More information about the llvm-commits mailing list