2 ## Test that we allow SHF_LINK_ORDER sections with sh_link=0.
3 ## SHF_LINK_ORDER sections with sh_link!=0 are ordered before others.
4 # RUN: llvm-mc -filetype=obj -triple=x86_64 %s -o %t.o
5 # RUN: ld.lld %t.o -o %t
6 # RUN: llvm-readelf -S -x .linkorder %t | FileCheck %s
8 # CHECK: [Nr] Name {{.*}} Size ES Flg Lk Inf
9 # CHECK-NEXT: [ 0] {{.*}}
10 # CHECK-NEXT: [ 1] .linkorder {{.*}} 000004 00 AL 3 0
11 # CHECK-NEXT: [ 2] .ignore {{.*}}
12 # CHECK-NEXT: [ 3] .text {{.*}}
14 # CHECK: Hex dump of section '.linkorder':
15 # CHECK-NEXT: [[#%x,ADDR:]] 01020003
17 # RUN: llvm-mc --filetype=obj -triple=x86_64 --defsym EXTRA=1 %s -o %t.o
18 # RUN: ld.lld %t.o -o %t1
19 # RUN: llvm-readelf -S -x .linkorder %t1 | FileCheck %s --check-prefix=CHECK1
21 # CHECK1: [Nr] Name {{.*}} Size ES Flg Lk Inf
22 # CHECK1-NEXT: [ 0] {{.*}}
23 # CHECK1-NEXT: [ 1] .linkorder {{.*}} 000005 00 AL 2 0
24 # CHECK1-NEXT: [ 2] .text {{.*}}
26 # CHECK1: Hex dump of section '.linkorder':
27 # CHECK1-NEXT: [[#%x,ADDR:]] 01020004 03
29 .section .text,"ax",@progbits,unique,0
31 .section .text,"ax",@progbits,unique,1
33 .section .linkorder,"ao",@progbits,0,unique,0
35 .section .linkorder,"ao",@progbits,.Ltext0
37 .section .linkorder,"ao",@progbits,.Ltext1
41 .section .linkorder,"a",@progbits
44 .section .ignore,"ao",@progbits,.Ltext1
47 .section .linkorder,"ao",@progbits,0,unique,3