1 RUN: llvm-readobj -program-headers %p/../../Object/Inputs/program-headers.elf-i386 \
2 RUN: | FileCheck %s -check-prefix ELF-I386
3 RUN: llvm-readobj -program-headers %p/../../Object/Inputs/program-headers.elf-x86-64 \
4 RUN: | FileCheck %s -check-prefix ELF-X86-64
5 RUN: llvm-readobj -program-headers %p/../../Object/Inputs/program-headers.mips \
6 RUN: | FileCheck %s -check-prefix ELF-MIPS
7 RUN: llvm-readobj -program-headers %p/../../Object/Inputs/program-headers.mips64 \
8 RUN: | FileCheck %s -check-prefix ELF-MIPS64
10 ## openbsd-phdrs.elf-x86-64 was generated using GNU ld (GNU Binutils for Ubuntu) 2.26.1.
11 ## llvm-mc -filetype=obj -triple=x86_64-pc-linux test.s -o main.o
12 ## ld -script linker.script main.o -o openbsd-phdrs.elf-x86-64
14 ## test.s is an empty file.
16 ## PHDRS { text PT_LOAD FILEHDR PHDRS; foo 0x65a3dbe6; bar 0x65a3dbe7; zed 0x65a41be6; }
17 ## Where 0x65a3dbe6 is the value of PT_OPENBSD_RANDOMIZE,
18 ## 0x65a3dbe7 is the value of PT_OPENBSD_WXNEEDED,
19 ## 0x65a41be6 is the value of PT_OPENBSD_BOOTDATA
20 ## SECTIONS { . = SIZEOF_HEADERS; .all : { *(.*) } : text }
21 RUN: llvm-readobj -program-headers %p/../../Object/Inputs/openbsd-phdrs.elf-x86-64 \
22 RUN: | FileCheck %s -check-prefix OPENBSD-X86-64
24 ELF-I386: ProgramHeaders [
25 ELF-I386-NEXT: ProgramHeader {
26 ELF-I386-NEXT: Type: PT_LOAD (0x1)
27 ELF-I386-NEXT: Offset: 0x0
28 ELF-I386-NEXT: VirtualAddress: 0x8048000
29 ELF-I386-NEXT: PhysicalAddress: 0x8048000
30 ELF-I386-NEXT: FileSize: 308
31 ELF-I386-NEXT: MemSize: 308
32 ELF-I386-NEXT: Flags [ (0x5)
33 ELF-I386-NEXT: PF_R (0x4)
34 ELF-I386-NEXT: PF_X (0x1)
36 ELF-I386-NEXT: Alignment: 4096
38 ELF-I386-NEXT: ProgramHeader {
39 ELF-I386-NEXT: Type: PT_GNU_STACK (0x6474E551)
40 ELF-I386-NEXT: Offset: 0x0
41 ELF-I386-NEXT: VirtualAddress: 0x0
42 ELF-I386-NEXT: PhysicalAddress: 0x0
43 ELF-I386-NEXT: FileSize: 0
44 ELF-I386-NEXT: MemSize: 0
45 ELF-I386-NEXT: Flags [ (0x6)
46 ELF-I386-NEXT: PF_R (0x4)
47 ELF-I386-NEXT: PF_W (0x2)
49 ELF-I386-NEXT: Alignment: 4
53 ELF-X86-64: ProgramHeaders [
54 ELF-X86-64-NEXT: ProgramHeader {
55 ELF-X86-64-NEXT: Type: PT_LOAD (0x1)
56 ELF-X86-64-NEXT: Offset: 0x0
57 ELF-X86-64-NEXT: VirtualAddress: 0x400000
58 ELF-X86-64-NEXT: PhysicalAddress: 0x400000
59 ELF-X86-64-NEXT: FileSize: 312
60 ELF-X86-64-NEXT: MemSize: 312
61 ELF-X86-64-NEXT: Flags [ (0x5)
62 ELF-X86-64-NEXT: PF_R (0x4)
63 ELF-X86-64-NEXT: PF_X (0x1)
65 ELF-X86-64-NEXT: Alignment: 2097152
67 ELF-X86-64-NEXT: ProgramHeader {
68 ELF-X86-64-NEXT: Type: PT_GNU_EH_FRAME (0x6474E550)
69 ELF-X86-64-NEXT: Offset: 0xF4
70 ELF-X86-64-NEXT: VirtualAddress: 0x4000F4
71 ELF-X86-64-NEXT: PhysicalAddress: 0x4000F4
72 ELF-X86-64-NEXT: FileSize: 20
73 ELF-X86-64-NEXT: MemSize: 20
74 ELF-X86-64-NEXT: Flags [ (0x4)
75 ELF-X86-64-NEXT: PF_R (0x4)
77 ELF-X86-64-NEXT: Alignment: 4
79 ELF-X86-64-NEXT: ProgramHeader {
80 ELF-X86-64-NEXT: Type: PT_GNU_STACK (0x6474E551)
81 ELF-X86-64-NEXT: Offset: 0x0
82 ELF-X86-64-NEXT: VirtualAddress: 0x0
83 ELF-X86-64-NEXT: PhysicalAddress: 0x0
84 ELF-X86-64-NEXT: FileSize: 0
85 ELF-X86-64-NEXT: MemSize: 0
86 ELF-X86-64-NEXT: Flags [ (0x6)
87 ELF-X86-64-NEXT: PF_R (0x4)
88 ELF-X86-64-NEXT: PF_W (0x2)
90 ELF-X86-64-NEXT: Alignment: 8
94 ELF-MIPS: Format: ELF32-mips
95 ELF-MIPS-NEXT: Arch: mips
96 ELF-MIPS-NEXT: AddressSize: 32bit
97 ELF-MIPS-NEXT: LoadName:
98 ELF-MIPS-NEXT: ProgramHeaders [
99 ELF-MIPS-NEXT: ProgramHeader {
100 ELF-MIPS-NEXT: Type: PT_MIPS_ABIFLAGS (0x70000003)
101 ELF-MIPS-NEXT: Offset: 0x98
102 ELF-MIPS-NEXT: VirtualAddress: 0x400098
103 ELF-MIPS-NEXT: PhysicalAddress: 0x400098
104 ELF-MIPS-NEXT: FileSize: 24
105 ELF-MIPS-NEXT: MemSize: 24
106 ELF-MIPS-NEXT: Flags [ (0x4)
107 ELF-MIPS-NEXT: PF_R (0x4)
109 ELF-MIPS-NEXT: Alignment: 8
111 ELF-MIPS-NEXT: ProgramHeader {
112 ELF-MIPS-NEXT: Type: PT_MIPS_REGINFO (0x70000000)
113 ELF-MIPS-NEXT: Offset: 0xB0
114 ELF-MIPS-NEXT: VirtualAddress: 0x4000B0
115 ELF-MIPS-NEXT: PhysicalAddress: 0x4000B0
116 ELF-MIPS-NEXT: FileSize: 24
117 ELF-MIPS-NEXT: MemSize: 24
118 ELF-MIPS-NEXT: Flags [ (0x4)
119 ELF-MIPS-NEXT: PF_R (0x4)
121 ELF-MIPS-NEXT: Alignment: 4
123 ELF-MIPS-NEXT: ProgramHeader {
124 ELF-MIPS-NEXT: Type: PT_LOAD (0x1)
125 ELF-MIPS-NEXT: Offset: 0x0
126 ELF-MIPS-NEXT: VirtualAddress: 0x400000
127 ELF-MIPS-NEXT: PhysicalAddress: 0x400000
128 ELF-MIPS-NEXT: FileSize: 224
129 ELF-MIPS-NEXT: MemSize: 224
130 ELF-MIPS-NEXT: Flags [ (0x5)
131 ELF-MIPS-NEXT: PF_R (0x4)
132 ELF-MIPS-NEXT: PF_X (0x1)
134 ELF-MIPS-NEXT: Alignment: 65536
138 ELF-MIPS64: Format: ELF64-mips
139 ELF-MIPS64-NEXT: Arch: mips64
140 ELF-MIPS64-NEXT: AddressSize: 64bit
141 ELF-MIPS64-NEXT: LoadName:
142 ELF-MIPS64-NEXT: ProgramHeaders [
143 ELF-MIPS64-NEXT: ProgramHeader {
144 ELF-MIPS64-NEXT: Type: PT_LOAD (0x1)
145 ELF-MIPS64-NEXT: Offset: 0x0
146 ELF-MIPS64-NEXT: VirtualAddress: 0x120000000
147 ELF-MIPS64-NEXT: PhysicalAddress: 0x120000000
148 ELF-MIPS64-NEXT: FileSize: 136
149 ELF-MIPS64-NEXT: MemSize: 136
150 ELF-MIPS64-NEXT: Flags [ (0x5)
151 ELF-MIPS64-NEXT: PF_R (0x4)
152 ELF-MIPS64-NEXT: PF_X (0x1)
154 ELF-MIPS64-NEXT: Alignment: 65536
158 OPENBSD-X86-64: ProgramHeaders [
159 OPENBSD-X86-64: ProgramHeader {
160 OPENBSD-X86-64: Type: PT_OPENBSD_RANDOMIZE
161 OPENBSD-X86-64-NEXT: Offset:
162 OPENBSD-X86-64-NEXT: VirtualAddress:
163 OPENBSD-X86-64-NEXT: PhysicalAddress:
164 OPENBSD-X86-64-NEXT: FileSize:
165 OPENBSD-X86-64-NEXT: MemSize:
166 OPENBSD-X86-64-NEXT: Flags [
167 OPENBSD-X86-64-NEXT: ]
168 OPENBSD-X86-64-NEXT: Alignment:
169 OPENBSD-X86-64-NEXT: }
170 OPENBSD-X86-64-NEXT: ProgramHeader {
171 OPENBSD-X86-64-NEXT: Type: PT_OPENBSD_WXNEEDED
172 OPENBSD-X86-64-NEXT: Offset:
173 OPENBSD-X86-64-NEXT: VirtualAddress:
174 OPENBSD-X86-64-NEXT: PhysicalAddress:
175 OPENBSD-X86-64-NEXT: FileSize:
176 OPENBSD-X86-64-NEXT: MemSize:
177 OPENBSD-X86-64-NEXT: Flags [
178 OPENBSD-X86-64-NEXT: ]
179 OPENBSD-X86-64-NEXT: Alignment:
180 OPENBSD-X86-64-NEXT: }
181 OPENBSD-X86-64-NEXT: ProgramHeader {
182 OPENBSD-X86-64-NEXT: Type: PT_OPENBSD_BOOTDATA
183 OPENBSD-X86-64-NEXT: Offset:
184 OPENBSD-X86-64-NEXT: VirtualAddress:
185 OPENBSD-X86-64-NEXT: PhysicalAddress:
186 OPENBSD-X86-64-NEXT: FileSize:
187 OPENBSD-X86-64-NEXT: MemSize:
188 OPENBSD-X86-64-NEXT: Flags [
189 OPENBSD-X86-64-NEXT: ]
190 OPENBSD-X86-64-NEXT: Alignment:
191 OPENBSD-X86-64-NEXT: }