43 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: ro PT_LOAD FLAGS(0x4); \6# RUN: } \7# RUN: SECTIONS { \8# RUN: .pad : { QUAD(0); } :exec \9# RUN: .text : { *(.text) } \10# RUN: .ro : { *(.ro) } :ro \11# RUN: }" > %t.script12# RUN: ld.lld -o %t --script %t.script %t.o13# RUN: llvm-readelf -S -l %t | FileCheck %s14 15## The ".pad" section is not "live" and should be ignored by the16## orphan placement.17##18## Check that the orphan section is placed correctly and belongs to19## the correct segment.20 21# CHECK: Section Headers22# CHECK: .pad23# CHECK-NEXT: .text24# CHECK-NEXT: .orphan225# CHECK-NEXT: .ro26# CHECK-NEXT: .orphan127 28# CHECK: Segment Sections29# CHECK-NEXT: .pad .text .orphan230# CHECK-NEXT: .ro .orphan131 32.section .text,"ax"33 ret34 35.section .ro,"a"36 .byte 037 38.section .orphan1,"a"39 .byte 040 41.section .orphan2,"ax"42 ret43