49 lines · plain
1# REQUIRES: x862## 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.o5# RUN: ld.lld %t.o -o %t6# RUN: llvm-readelf -S -x .linkorder %t | FileCheck %s7 8# CHECK: [Nr] Name {{.*}} Size ES Flg Lk Inf9# CHECK-NEXT: [ 0] {{.*}}10# CHECK-NEXT: [ 1] .linkorder {{.*}} 000004 00 AL 3 011# CHECK-NEXT: [ 2] .ignore {{.*}}12# CHECK-NEXT: [ 3] .text {{.*}}13 14# CHECK: Hex dump of section '.linkorder':15# CHECK-NEXT: [[#%x,ADDR:]] 0102000316 17# RUN: llvm-mc --filetype=obj -triple=x86_64 --defsym EXTRA=1 %s -o %t.o18# RUN: ld.lld %t.o -o %t119# RUN: llvm-readelf -S -x .linkorder %t1 | FileCheck %s --check-prefix=CHECK120 21# CHECK1: [Nr] Name {{.*}} Size ES Flg Lk Inf22# CHECK1-NEXT: [ 0] {{.*}}23# CHECK1-NEXT: [ 1] .linkorder {{.*}} 000005 00 AL 2 024# CHECK1-NEXT: [ 2] .text {{.*}}25 26# CHECK1: Hex dump of section '.linkorder':27# CHECK1-NEXT: [[#%x,ADDR:]] 01020004 0328 29.section .text,"ax",@progbits,unique,030.Ltext0:31.section .text,"ax",@progbits,unique,132.Ltext1:33.section .linkorder,"ao",@progbits,0,unique,034 .byte 035.section .linkorder,"ao",@progbits,.Ltext036 .byte 137.section .linkorder,"ao",@progbits,.Ltext138 .byte 239 40.ifdef EXTRA41.section .linkorder,"a",@progbits42 .byte 443.else44.section .ignore,"ao",@progbits,.Ltext145.endif46 47.section .linkorder,"ao",@progbits,0,unique,348 .byte 349