35 lines · plain
1# REQUIRES: x862# RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux %s -o %t.o3# RUN: echo "PHDRS { \4# RUN: exec PT_LOAD FLAGS(0x4 | 0x1); \5# RUN: rw PT_LOAD FLAGS(0x4 | 0x2); \6# RUN: } \7# RUN: SECTIONS { \8# RUN: .text : { *(.text) } :exec \9# RUN: .empty : { *(.empty) } :rw \10# RUN: .rw : { *(.rw) } \11# RUN: }" > %t.script12# RUN: ld.lld -o %t --script %t.script %t.o13# RUN: llvm-readelf -S -l %t | FileCheck %s14 15## Check that the orphan section is placed correctly and belongs to16## the correct segment.17 18# CHECK: Section Headers19# CHECK: .text20# CHECK-NEXT: .orphan21# CHECK-NEXT: .rw22 23# CHECK: Segment Sections24# CHECK-NEXT: .text .orphan25# CHECK-NEXT: .rw26 27.section .text,"ax"28 ret29 30.section .rw,"aw"31 .quad 032 33.section .orphan,"ax"34 ret35