29 lines · plain
1# REQUIRES: x862## Document the behavior when an output section is specified by multiple3## INSERT commands. It is discouraged in the real world.4 5# RUN: llvm-mc -filetype=obj -triple=x86_64 %p/Inputs/insert-after.s -o %t.o6# RUN: ld.lld -T %s %t.o -o %t7# RUN: llvm-readelf -S -l %t | FileCheck %s8 9# CHECK: Name Type Address Off10# CHECK-NEXT: NULL 0000000000000000 00000011# CHECK-NEXT: .text PROGBITS 0000000000201158 00015812# CHECK-NEXT: .foo.text PROGBITS 0000000000201160 00016013# CHECK-NEXT: .foo.data PROGBITS 0000000000202168 00016814# CHECK: Type15# CHECK-NEXT: PHDR {{.*}} R16# CHECK-NEXT: LOAD {{.*}} R17# CHECK-NEXT: LOAD {{.*}} R E18# CHECK-NEXT: LOAD {{.*}} RW19# CHECK-NEXT: GNU_STACK {{.*}} RW20 21## First, move .foo.data after .foo.text22SECTIONS { .foo.data : { *(.foo.data) } } INSERT AFTER .foo.text;23 24## Next, move .foo.text after .foo.data25SECTIONS { .foo.text : { *(.foo.text) } } INSERT AFTER .foo.data;26 27## Then, move .foo.data after .foo.text again.28SECTIONS { .foo.data : { *(.foo.data) } } INSERT AFTER .foo.text;29