forked from OSchip/llvm-project
Revert "Only restrict order if both sections are in the script."
This reverts commit r282015. It broke some bots. llvm-svn: 282021
This commit is contained in:
parent
e90797794f
commit
bf04708e11
|
@ -664,12 +664,12 @@ template <class ELFT> int LinkerScript<ELFT>::getSectionIndex(StringRef Name) {
|
|||
}
|
||||
|
||||
// A compartor to sort output sections. Returns -1 or 1 if
|
||||
// A and B are mentioned in linker script. Otherwise, returns 0.
|
||||
// A or B are mentioned in linker script. Otherwise, returns 0.
|
||||
template <class ELFT>
|
||||
int LinkerScript<ELFT>::compareSections(StringRef A, StringRef B) {
|
||||
int I = getSectionIndex(A);
|
||||
int J = getSectionIndex(B);
|
||||
if (I == INT_MAX || J == INT_MAX)
|
||||
if (I == INT_MAX && J == INT_MAX)
|
||||
return 0;
|
||||
return I < J ? -1 : 1;
|
||||
}
|
||||
|
|
|
@ -14,8 +14,8 @@
|
|||
# TEXTORPHAN: Sections:
|
||||
# TEXTORPHAN-NEXT: Idx Name
|
||||
# TEXTORPHAN-NEXT: 0
|
||||
# TEXTORPHAN-NEXT: 1 .text
|
||||
# TEXTORPHAN-NEXT: 2 .writable
|
||||
# TEXTORPHAN-NEXT: 1 .writable
|
||||
# TEXTORPHAN-NEXT: 2 .text
|
||||
|
||||
# WRITABLEORPHAN: Sections:
|
||||
# WRITABLEORPHAN-NEXT: Idx Name
|
||||
|
|
|
@ -6,13 +6,13 @@
|
|||
# RUN: llvm-readobj -t %t1 | FileCheck %s
|
||||
|
||||
# CHECK: Name: foo1
|
||||
# CHECK-NEXT: Value: 0x288
|
||||
# CHECK-NEXT: Value: 0x200
|
||||
|
||||
# CHECK: Name: foo2
|
||||
# CHECK-NEXT: Value: 0x290
|
||||
# CHECK-NEXT: Value: 0x208
|
||||
|
||||
# CHECK: Name: foo3
|
||||
# CHECK-NEXT: Value: 0x294
|
||||
# CHECK-NEXT: Value: 0x20C
|
||||
|
||||
.section .foo.1,"a"
|
||||
.long 1
|
||||
|
|
|
@ -1,16 +0,0 @@
|
|||
# REQUIRES: x86
|
||||
# RUN: llvm-mc -filetype=obj -triple=x86_64-pc-linux %s -o %t
|
||||
|
||||
# RUN: echo "SECTIONS { foo : {*(foo)} }" > %t.script
|
||||
# RUN: ld.lld -o %t1 --script %t.script %t -shared
|
||||
# RUN: llvm-readobj -elf-output-style=GNU -s %t1 | FileCheck %s
|
||||
|
||||
# CHECK: .dynsym {{.*}} A
|
||||
# CHECK-NEXT: .hash {{.*}} A
|
||||
# CHECK-NEXT: .dynstr {{.*}} A
|
||||
# CHECK-NEXT: .text {{.*}} AX
|
||||
# CHECK-NEXT: .dynamic {{.*}} WA
|
||||
# CHECK-NEXT: foo {{.*}} WA
|
||||
|
||||
.section foo, "aw"
|
||||
.byte 0
|
Loading…
Reference in New Issue