2 # RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux %s -o %t
4 # RUN: ld.lld %t -o %t1
5 # RUN: llvm-readobj --program-headers %t1 | FileCheck --check-prefix=ROSEGMENT %s
6 # RUN: ld.lld --no-rosegment --rosegment %t -o - | cmp - %t1
7 # RUN: ld.lld --omagic --no-omagic %t -o - | cmp - %t1
9 # ROSEGMENT: ProgramHeader {
10 # ROSEGMENT: Type: PT_LOAD
11 # ROSEGMENT-NEXT: Offset: 0x0
12 # ROSEGMENT-NEXT: VirtualAddress:
13 # ROSEGMENT-NEXT: PhysicalAddress:
14 # ROSEGMENT-NEXT: FileSize:
15 # ROSEGMENT-NEXT: MemSize:
16 # ROSEGMENT-NEXT: Flags [
17 # ROSEGMENT-NEXT: PF_R
19 # ROSEGMENT-NEXT: Alignment: 4096
21 # ROSEGMENT-NEXT: ProgramHeader {
22 # ROSEGMENT-NEXT: Type: PT_LOAD
23 # ROSEGMENT-NEXT: Offset: 0x15C
24 # ROSEGMENT-NEXT: VirtualAddress:
25 # ROSEGMENT-NEXT: PhysicalAddress:
26 # ROSEGMENT-NEXT: FileSize:
27 # ROSEGMENT-NEXT: MemSize:
28 # ROSEGMENT-NEXT: Flags [
29 # ROSEGMENT-NEXT: PF_R
30 # ROSEGMENT-NEXT: PF_X
32 # ROSEGMENT-NEXT: Alignment: 4096
34 # ROSEGMENT-NEXT: ProgramHeader {
35 # ROSEGMENT-NEXT: Type: PT_LOAD
36 # ROSEGMENT-NEXT: Offset: 0x15E
37 # ROSEGMENT-NEXT: VirtualAddress:
38 # ROSEGMENT-NEXT: PhysicalAddress:
39 # ROSEGMENT-NEXT: FileSize: 1
40 # ROSEGMENT-NEXT: MemSize: 1
41 # ROSEGMENT-NEXT: Flags [
42 # ROSEGMENT-NEXT: PF_R
43 # ROSEGMENT-NEXT: PF_W
45 # ROSEGMENT-NEXT: Alignment: 4096
48 # RUN: ld.lld --no-rosegment %t -o %t2
49 # RUN: llvm-readobj --program-headers %t2 | FileCheck --check-prefix=NOROSEGMENT %s
51 # NOROSEGMENT: ProgramHeader {
52 # NOROSEGMENT: Type: PT_LOAD
53 # NOROSEGMENT-NEXT: Offset: 0x0
54 # NOROSEGMENT-NEXT: VirtualAddress:
55 # NOROSEGMENT-NEXT: PhysicalAddress:
56 # NOROSEGMENT-NEXT: FileSize:
57 # NOROSEGMENT-NEXT: MemSize:
58 # NOROSEGMENT-NEXT: Flags [
59 # NOROSEGMENT-NEXT: PF_R
60 # NOROSEGMENT-NEXT: PF_X
62 # NOROSEGMENT-NEXT: Alignment: 4096
64 # NOROSEGMENT-NEXT: ProgramHeader {
65 # NOROSEGMENT-NEXT: Type: PT_LOAD
66 # NOROSEGMENT-NEXT: Offset: 0x126
67 # NOROSEGMENT-NEXT: VirtualAddress:
68 # NOROSEGMENT-NEXT: PhysicalAddress:
69 # NOROSEGMENT-NEXT: FileSize:
70 # NOROSEGMENT-NEXT: MemSize:
71 # NOROSEGMENT-NEXT: Flags [
72 # NOROSEGMENT-NEXT: PF_R
73 # NOROSEGMENT-NEXT: PF_W
75 # NOROSEGMENT-NEXT: Alignment: 4096
77 # NOROSEGMENT-NEXT: ProgramHeader {
78 # NOROSEGMENT-NEXT: Type: PT_GNU_STACK
80 # RUN: ld.lld -N %t -o %t3
81 # RUN: llvm-readobj --program-headers %t3 | FileCheck --check-prefix=OMAGIC %s
82 # RUN: ld.lld --omagic %t -o %t3
83 # RUN: llvm-readobj --program-headers %t3 | FileCheck --check-prefix=OMAGIC %s
85 # OMAGIC: ProgramHeader {
86 # OMAGIC: Type: PT_LOAD
87 # OMAGIC-NEXT: Offset: 0xB0
88 # OMAGIC-NEXT: VirtualAddress:
89 # OMAGIC-NEXT: PhysicalAddress:
90 # OMAGIC-NEXT: FileSize:
91 # OMAGIC-NEXT: MemSize:
92 # OMAGIC-NEXT: Flags [
97 # OMAGIC-NEXT: Alignment: 4
99 # OMAGIC-NEXT: ProgramHeader {
100 # OMAGIC-NEXT: Type: PT_GNU_STACK
102 # RUN: ld.lld -n %t -o %t4
103 # RUN: llvm-readobj --program-headers %t4 | FileCheck --check-prefix=NMAGIC %s
104 # RUN: ld.lld --nmagic %t -o %t4
105 # RUN: llvm-readobj --program-headers %t4 | FileCheck --check-prefix=NMAGIC %s
107 # NMAGIC: ProgramHeader {
108 # NMAGIC-NEXT: Type: PT_LOAD
109 # NMAGIC-NEXT: Offset: 0x120
110 # NMAGIC-NEXT: VirtualAddress:
111 # NMAGIC-NEXT: PhysicalAddress:
112 # NMAGIC-NEXT: FileSize: 1
113 # NMAGIC-NEXT: MemSize: 1
114 # NMAGIC-NEXT: Flags [
117 # NMAGIC-NEXT: Alignment: 1
119 # NMAGIC-NEXT: ProgramHeader {
120 # NMAGIC-NEXT: Type: PT_LOAD
121 # NMAGIC-NEXT: Offset: 0x124
122 # NMAGIC-NEXT: VirtualAddress:
123 # NMAGIC-NEXT: PhysicalAddress:
124 # NMAGIC-NEXT: FileSize: 2
125 # NMAGIC-NEXT: MemSize: 2
126 # NMAGIC-NEXT: Flags [
130 # NMAGIC-NEXT: Alignment: 4
132 # NMAGIC-NEXT: ProgramHeader {
133 # NMAGIC-NEXT: Type: PT_LOAD (0x1)
134 # NMAGIC-NEXT: Offset: 0x126
135 # NMAGIC-NEXT: VirtualAddress:
136 # NMAGIC-NEXT: PhysicalAddress:
137 # NMAGIC-NEXT: FileSize: 1
138 # NMAGIC-NEXT: MemSize: 1
139 # NMAGIC-NEXT: Flags [
143 # NMAGIC-NEXT: Alignment: 1