[llvm-branch-commits] [lld] r324471 - Merging r324467 and r324468:

Hans Wennborg via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Wed Feb 7 02:50:49 PST 2018


Author: hans
Date: Wed Feb  7 02:50:49 2018
New Revision: 324471

URL: http://llvm.org/viewvc/llvm-project?rev=324471&view=rev
Log:
Merging r324467 and r324468:
------------------------------------------------------------------------
r324467 | atanasyan | 2018-02-07 11:02:49 +0100 (Wed, 07 Feb 2018) | 9 lines

[ELF][MIPS] Ignore incorrect version definition index for _gp_disp symbol

MIPS BFD linker puts _gp_disp symbol into DSO files and assigns zero
version definition index to it. This value means 'unversioned local
symbol' while _gp_disp is a section global symbol. We have to handle
this bug in the LLD because BFD linker is used for building MIPS
toolchain libraries.

Differential revision: https://reviews.llvm.org/D42486
------------------------------------------------------------------------

------------------------------------------------------------------------
r324468 | atanasyan | 2018-02-07 11:14:22 +0100 (Wed, 07 Feb 2018) | 1 line

[ELF][MIPS] Mark the test as required MIPS target support. NFC
------------------------------------------------------------------------

Added:
    lld/branches/release_60/test/ELF/Inputs/mips-gp-dips-corrupt-ver.s
      - copied unchanged from r324467, lld/trunk/test/ELF/Inputs/mips-gp-dips-corrupt-ver.s
    lld/branches/release_60/test/ELF/Inputs/mips-gp-dips-corrupt-ver.so
      - copied unchanged from r324467, lld/trunk/test/ELF/Inputs/mips-gp-dips-corrupt-ver.so
    lld/branches/release_60/test/ELF/mips-gp-disp-ver.s
      - copied, changed from r324467, lld/trunk/test/ELF/mips-gp-disp-ver.s
Modified:
    lld/branches/release_60/   (props changed)
    lld/branches/release_60/ELF/InputFiles.cpp

Propchange: lld/branches/release_60/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Wed Feb  7 02:50:49 2018
@@ -1 +1 @@
-/lld/trunk:321983,321986,322041,322259,322264,322359,322421,322801,323155,323221,323243,323288,323395-323396,323399,323440,323449,323456,323625,324043
+/lld/trunk:321983,321986,322041,322259,322264,322359,322421,322801,323155,323221,323243,323288,323395-323396,323399,323440,323449,323456,323625,324043,324467-324468

Modified: lld/branches/release_60/ELF/InputFiles.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/branches/release_60/ELF/InputFiles.cpp?rev=324471&r1=324470&r2=324471&view=diff
==============================================================================
--- lld/branches/release_60/ELF/InputFiles.cpp (original)
+++ lld/branches/release_60/ELF/InputFiles.cpp Wed Feb  7 02:50:49 2018
@@ -856,6 +856,14 @@ template <class ELFT> void SharedFile<EL
       continue;
     }
 
+    if (Config->EMachine == EM_MIPS) {
+      // FIXME: 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 (Versym && VersymIndex == VER_NDX_LOCAL && Name == "_gp_disp")
+        continue;
+    }
+
     const Elf_Verdef *Ver = nullptr;
     if (VersymIndex != VER_NDX_GLOBAL) {
       if (VersymIndex >= Verdefs.size() || VersymIndex == VER_NDX_LOCAL) {

Copied: lld/branches/release_60/test/ELF/mips-gp-disp-ver.s (from r324467, lld/trunk/test/ELF/mips-gp-disp-ver.s)
URL: http://llvm.org/viewvc/llvm-project/lld/branches/release_60/test/ELF/mips-gp-disp-ver.s?p2=lld/branches/release_60/test/ELF/mips-gp-disp-ver.s&p1=lld/trunk/test/ELF/mips-gp-disp-ver.s&r1=324467&r2=324471&rev=324471&view=diff
==============================================================================
--- lld/trunk/test/ELF/mips-gp-disp-ver.s (original)
+++ lld/branches/release_60/test/ELF/mips-gp-disp-ver.s Wed Feb  7 02:50:49 2018
@@ -7,6 +7,8 @@
 # RUN: llvm-mc -filetype=obj -triple=mips-unknown-linux %s -o %t.o
 # RUN: ld.lld %t.o %S/Inputs/mips-gp-dips-corrupt-ver.so
 
+# REQUIRES: mips
+
   .global __start
   .text
 __start:




More information about the llvm-branch-commits mailing list