]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - test/elf/rosegment.test
Vendor import of lld trunk r233088:
[FreeBSD/FreeBSD.git] / test / elf / rosegment.test
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 \
4 RUN: --noinhibit-exec
5 RUN: lld -flavor gnu -target x86_64 %p/Inputs/rodata.o --rosegment -o %t2.elf \
6 RUN: --noinhibit-exec
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
9
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
16
17 #RO-SEGMENT:    Type: PT_PHDR
18 #RO-SEGMENT:    Type: PT_INTERP
19 #RO-SEGMENT:    Type: PT_LOAD
20 #RO-SEGMENT:    Type: PT_LOAD
21 #RO-SEGMENT:   Flags [
22 #RO-SEGMENT:      PF_R (0x4)
23 #RO-SEGMENT:    ]
24 #RO-SEGMENT:    Type: PT_LOAD
25 #RO-SEGMENT:    Type: PT_DYNAMIC
26 #RO-SEGMENT:    Type: PT_GNU_EH_FRAME