1 # Tests that the option --rosegment produces an output file with a separate
2 # segment created for read only data.
3 RUN: lld -flavor gnu -target x86_64 %p/Inputs/rodata.o -o %t1.elf \
5 RUN: lld -flavor gnu -target x86_64 %p/Inputs/rodata.o --rosegment -o %t2.elf \
7 RUN: llvm-readobj -program-headers %t1.elf | FileCheck %s -check-prefix=NORO-SEGMENT
8 RUN: llvm-readobj -program-headers %t2.elf | FileCheck %s -check-prefix=RO-SEGMENT
10 #NORO-SEGMENT: Type: PT_PHDR
11 #NORO-SEGMENT: Type: PT_INTERP
12 #NORO-SEGMENT: Type: PT_LOAD
13 #NORO-SEGMENT: Type: PT_LOAD
14 #NORO-SEGMENT: Type: PT_DYNAMIC
15 #NORO-SEGMENT: Type: PT_GNU_EH_FRAME
17 #RO-SEGMENT: Type: PT_PHDR
18 #RO-SEGMENT: Type: PT_INTERP
19 #RO-SEGMENT: Type: PT_LOAD
20 #RO-SEGMENT: Type: PT_LOAD
22 #RO-SEGMENT: PF_R (0x4)
24 #RO-SEGMENT: Type: PT_LOAD
25 #RO-SEGMENT: Type: PT_DYNAMIC
26 #RO-SEGMENT: Type: PT_GNU_EH_FRAME