summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSimon Atanasyan <simon@atanasyan.com>2016-06-20 11:37:56 +0000
committerSimon Atanasyan <simon@atanasyan.com>2016-06-20 11:37:56 +0000
commit7b8481bf95b30da7f16fd04c6e88d7b1a80b7f1b (patch)
treead608e6b6b93c4735fd8ce03b84b3e95f1405eb9
parent3688c4ca78e0971fec9fda9c22d8d361df10cb9e (diff)
downloadbcm5719-llvm-7b8481bf95b30da7f16fd04c6e88d7b1a80b7f1b.tar.gz
bcm5719-llvm-7b8481bf95b30da7f16fd04c6e88d7b1a80b7f1b.zip
[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. llvm-svn: 273151
-rw-r--r--lld/ELF/OutputSections.cpp6
-rw-r--r--lld/test/ELF/mips-dynamic.s2
-rw-r--r--lld/test/ELF/mips-plt-copy.s2
-rw-r--r--lld/test/ELF/mips-sto-plt.s16
4 files changed, 14 insertions, 12 deletions
diff --git a/lld/ELF/OutputSections.cpp b/lld/ELF/OutputSections.cpp
index 040657a6b81..4b71874511f 100644
--- a/lld/ELF/OutputSections.cpp
+++ b/lld/ELF/OutputSections.cpp
@@ -1277,8 +1277,10 @@ static bool sortMipsSymbols(const std::pair<SymbolBody *, unsigned> &L,
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;
}
diff --git a/lld/test/ELF/mips-dynamic.s b/lld/test/ELF/mips-dynamic.s
index 797628b7b51..cceaf6d0cbd 100644
--- a/lld/test/ELF/mips-dynamic.s
+++ b/lld/test/ELF/mips-dynamic.s
@@ -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
diff --git a/lld/test/ELF/mips-plt-copy.s b/lld/test/ELF/mips-plt-copy.s
index bdbb1d71f31..58883d88456 100644
--- a/lld/test/ELF/mips-plt-copy.s
+++ b/lld/test/ELF/mips-plt-copy.s
@@ -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
diff --git a/lld/test/ELF/mips-sto-plt.s b/lld/test/ELF/mips-sto-plt.s
index 18964e96d05..bd8de416680 100644
--- a/lld/test/ELF/mips-sto-plt.s
+++ b/lld/test/ELF/mips-sto-plt.s
@@ -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: }
OpenPOWER on IntegriCloud