[lld] 634a722 - [ELF] Clarify a workaround for mips GNU ld<2.31

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


Author: Fangrui Song
Date: 2022-09-04T15:38:52-07:00
New Revision: 634a722dd926b570ac926a6f7f744a26584721a9

URL: https://github.com/llvm/llvm-project/commit/634a722dd926b570ac926a6f7f744a26584721a9
DIFF: https://github.com/llvm/llvm-project/commit/634a722dd926b570ac926a6f7f744a26584721a9.diff

LOG: [ELF] Clarify a workaround for mips GNU ld<2.31

Added: 
    

Modified: 
    lld/ELF/InputFiles.cpp

Removed: 
    


################################################################################
diff  --git a/lld/ELF/InputFiles.cpp b/lld/ELF/InputFiles.cpp
index 88ba11d30653..0290244efe2f 100644
--- a/lld/ELF/InputFiles.cpp
+++ b/lld/ELF/InputFiles.cpp
@@ -1486,10 +1486,10 @@ template <class ELFT> void SharedFile::parse() {
       continue;
     }
 
-    // MIPS BFD linker puts _gp_disp symbol into DSO files and incorrectly
-    // assigns VER_NDX_LOCAL to this section global symbol. Here is a
-    // workaround for this bug.
-    if (config->emachine == EM_MIPS && idx == VER_NDX_LOCAL &&
+    // In GNU ld < 2.31 (before 3be08ea4728b56d35e136af4e6fd3086ade17764), the
+    // MIPS port puts _gp_disp symbol into DSO files and incorrectly assigns
+    // VER_NDX_LOCAL. Workaround this bug.
+    if (idx == VER_NDX_LOCAL && config->emachine == EM_MIPS &&
         name == "_gp_disp")
       continue;
 


        


More information about the llvm-commits mailing list