[lld] r273151 - [ELF][MIPS] Fix predicate used for sorting MIPS dynamic symbol tables

Simon Atanasyan via llvm-commits llvm-commits at lists.llvm.org
Mon Jun 20 04:37:58 PDT 2016


Author: atanasyan
Date: Mon Jun 20 06:37:56 2016
New Revision: 273151

URL: http://llvm.org/viewvc/llvm-project?rev=273151&view=rev
Log:
[ELF][MIPS] Fix predicate used for sorting MIPS dynamic symbol tables

Now it conforms requirement for std::stable_sort predicates. That
resolves build-bot failures on Windows hosts.

Modified:
    lld/trunk/ELF/OutputSections.cpp
    lld/trunk/test/ELF/mips-dynamic.s
    lld/trunk/test/ELF/mips-plt-copy.s
    lld/trunk/test/ELF/mips-sto-plt.s

Modified: lld/trunk/ELF/OutputSections.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/OutputSections.cpp?rev=273151&r1=273150&r2=273151&view=diff
==============================================================================
--- lld/trunk/ELF/OutputSections.cpp (original)
+++ lld/trunk/ELF/OutputSections.cpp Mon Jun 20 06:37:56 2016
@@ -1277,8 +1277,10 @@ static bool sortMipsSymbols(const std::p
                             const std::pair<SymbolBody *, unsigned> &R) {
   // Sort entries related to non-local preemptible symbols by GOT indexes.
   // All other entries go to the first part of GOT in arbitrary order.
-  if (!L.first->IsInGlobalMipsGot || !R.first->IsInGlobalMipsGot)
-    return !L.first->IsInGlobalMipsGot;
+  bool LIsInLocalGot = !L.first->IsInGlobalMipsGot;
+  bool RIsInLocalGot = !R.first->IsInGlobalMipsGot;
+  if (LIsInLocalGot || RIsInLocalGot)
+    return !RIsInLocalGot;
   return L.first->GotIndex < R.first->GotIndex;
 }
 

Modified: lld/trunk/test/ELF/mips-dynamic.s
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/ELF/mips-dynamic.s?rev=273151&r1=273150&r2=273151&view=diff
==============================================================================
--- lld/trunk/test/ELF/mips-dynamic.s (original)
+++ lld/trunk/test/ELF/mips-dynamic.s Mon Jun 20 06:37:56 2016
@@ -71,8 +71,8 @@
 # DSO:      ]
 # DSO:      DynamicSymbols [
 # DSO:          Name: @
-# DSO:          Name: _foo@
 # DSO:          Name: __start@
+# DSO:          Name: _foo@
 # DSO:      ]
 # DSO:      DynamicSection [
 # DSO-NEXT:   Tag        Type                 Name/Value

Modified: lld/trunk/test/ELF/mips-plt-copy.s
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/ELF/mips-plt-copy.s?rev=273151&r1=273150&r2=273151&view=diff
==============================================================================
--- lld/trunk/test/ELF/mips-plt-copy.s (original)
+++ lld/trunk/test/ELF/mips-plt-copy.s Mon Jun 20 06:37:56 2016
@@ -12,8 +12,8 @@
 
 # CHECK:      Relocations [
 # CHECK-NEXT:   Section ({{.*}}) .rel.dyn {
-# CHECK-NEXT:     0x{{[0-9A-F]+}} R_MIPS_COPY data1 0x0
 # CHECK-NEXT:     0x{{[0-9A-F]+}} R_MIPS_COPY data0 0x0
+# CHECK-NEXT:     0x{{[0-9A-F]+}} R_MIPS_COPY data1 0x0
 # CHECK-NEXT:   }
 # CHECK-NEXT:   Section ({{.*}}) .rel.plt {
 # CHECK-NEXT:     0x{{[0-9A-F]+}} R_MIPS_JUMP_SLOT foo0 0x0

Modified: lld/trunk/test/ELF/mips-sto-plt.s
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/ELF/mips-sto-plt.s?rev=273151&r1=273150&r2=273151&view=diff
==============================================================================
--- lld/trunk/test/ELF/mips-sto-plt.s (original)
+++ lld/trunk/test/ELF/mips-sto-plt.s Mon Jun 20 06:37:56 2016
@@ -10,23 +10,23 @@
 # REQUIRES: mips
 
 # CHECK:      Symbol {
-# CHECK:        Name: foo1@
-# CHECK-NEXT:   Value: 0x20050
+# CHECK:        Name: foo0@
+# CHECK-NEXT:   Value: 0x0
 # CHECK-NEXT:   Size: 0
 # CHECK-NEXT:   Binding: Global
 # CHECK-NEXT:   Type: Function
-# CHECK-NEXT:   Other [ (0x8)
-# CHECK-NEXT:     STO_MIPS_PLT
-# CHECK-NEXT:   ]
+# CHECK-NEXT:   Other: 0
 # CHECK-NEXT:   Section: Undefined
 # CHECK-NEXT: }
 # CHECK:      Symbol {
-# CHECK:        Name: foo0@
-# CHECK-NEXT:   Value: 0x0
+# CHECK:        Name: foo1@
+# CHECK-NEXT:   Value: 0x20050
 # CHECK-NEXT:   Size: 0
 # CHECK-NEXT:   Binding: Global
 # CHECK-NEXT:   Type: Function
-# CHECK-NEXT:   Other: 0
+# CHECK-NEXT:   Other [ (0x8)
+# CHECK-NEXT:     STO_MIPS_PLT
+# CHECK-NEXT:   ]
 # CHECK-NEXT:   Section: Undefined
 # CHECK-NEXT: }
 




More information about the llvm-commits mailing list