[lld] 1e402f0 - [ELF] Remove unneeded @@ check. NFC

Fangrui Song via llvm-commits llvm-commits at lists.llvm.org
Sun Sep 4 15:15:48 PDT 2022


Author: Fangrui Song
Date: 2022-09-04T15:15:40-07:00
New Revision: 1e402f02f0a555721d6f6598c6c64201cd2abc15

URL: https://github.com/llvm/llvm-project/commit/1e402f02f0a555721d6f6598c6c64201cd2abc15
DIFF: https://github.com/llvm/llvm-project/commit/1e402f02f0a555721d6f6598c6c64201cd2abc15.diff

LOG: [ELF] Remove unneeded @@ check. NFC

Added: 
    

Modified: 
    lld/ELF/Symbols.cpp

Removed: 
    


################################################################################
diff  --git a/lld/ELF/Symbols.cpp b/lld/ELF/Symbols.cpp
index 985e483df2ad..d19a7603357d 100644
--- a/lld/ELF/Symbols.cpp
+++ b/lld/ELF/Symbols.cpp
@@ -536,17 +536,6 @@ bool Symbol::shouldReplace(const Defined &other) const {
   if (!isDefined())
     return true;
 
-  // .symver foo,foo@@VER unfortunately creates two defined symbols: foo and
-  // foo@@VER. In GNU ld, if foo and foo@@VER are in the same file, foo is
-  // ignored. In our implementation, when this is foo, this->getName() may still
-  // contain @@, return true in this case as well.
-  if (LLVM_UNLIKELY(file == other.file)) {
-    if (other.getName().contains("@@"))
-      return true;
-    if (getName().contains("@@"))
-      return false;
-  }
-
   // Incoming STB_GLOBAL overrides STB_WEAK/STB_GNU_UNIQUE. -fgnu-unique changes
   // some vague linkage data in COMDAT from STB_WEAK to STB_GNU_UNIQUE. Treat
   // STB_GNU_UNIQUE like STB_WEAK so that we prefer the first among all


        


More information about the llvm-commits mailing list