[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
This commit is contained in:
Simon Atanasyan 2016-06-20 11:37:56 +00:00
parent 3688c4ca78
commit 7b8481bf95
4 changed files with 15 additions and 13 deletions

View File

@ -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;
}

View File

@ -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

View File

@ -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

View File

@ -9,6 +9,15 @@
# REQUIRES: mips
# CHECK: Symbol {
# CHECK: Name: foo0@
# CHECK-NEXT: Value: 0x0
# CHECK-NEXT: Size: 0
# CHECK-NEXT: Binding: Global
# CHECK-NEXT: Type: Function
# CHECK-NEXT: Other: 0
# CHECK-NEXT: Section: Undefined
# CHECK-NEXT: }
# CHECK: Symbol {
# CHECK: Name: foo1@
# CHECK-NEXT: Value: 0x20050
@ -20,15 +29,6 @@
# CHECK-NEXT: ]
# CHECK-NEXT: Section: Undefined
# CHECK-NEXT: }
# CHECK: Symbol {
# CHECK: Name: foo0@
# CHECK-NEXT: Value: 0x0
# CHECK-NEXT: Size: 0
# CHECK-NEXT: Binding: Global
# CHECK-NEXT: Type: Function
# CHECK-NEXT: Other: 0
# CHECK-NEXT: Section: Undefined
# CHECK-NEXT: }
# CHECK: Primary GOT {
# CHECK: Local entries [