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 -l %p/../../Object/Inputs/program-headers.elf-i386 \
4 # RUN: | FileCheck %s -check-prefix ELF-I386
6 # ELF-I386: ProgramHeaders [
7 # ELF-I386-NEXT: ProgramHeader {
8 # ELF-I386-NEXT: Type: PT_LOAD (0x1)
9 # ELF-I386-NEXT: Offset: 0x0
10 # ELF-I386-NEXT: VirtualAddress: 0x8048000
11 # ELF-I386-NEXT: PhysicalAddress: 0x8048000
12 # ELF-I386-NEXT: FileSize: 308
13 # ELF-I386-NEXT: MemSize: 308
14 # ELF-I386-NEXT: Flags [ (0x5)
15 # ELF-I386-NEXT: PF_R (0x4)
16 # ELF-I386-NEXT: PF_X (0x1)
18 # ELF-I386-NEXT: Alignment: 4096
20 # ELF-I386-NEXT: ProgramHeader {
21 # ELF-I386-NEXT: Type: PT_GNU_STACK (0x6474E551)
22 # ELF-I386-NEXT: Offset: 0x0
23 # ELF-I386-NEXT: VirtualAddress: 0x0
24 # ELF-I386-NEXT: PhysicalAddress: 0x0
25 # ELF-I386-NEXT: FileSize: 0
26 # ELF-I386-NEXT: MemSize: 0
27 # ELF-I386-NEXT: Flags [ (0x6)
28 # ELF-I386-NEXT: PF_R (0x4)
29 # ELF-I386-NEXT: PF_W (0x2)
31 # ELF-I386-NEXT: Alignment: 4
35 # RUN: llvm-readobj -l %p/../../Object/Inputs/program-headers.elf-x86-64 \
36 # RUN: | FileCheck %s -check-prefix ELF-X86-64
38 # ELF-X86-64: ProgramHeaders [
39 # ELF-X86-64-NEXT: ProgramHeader {
40 # ELF-X86-64-NEXT: Type: PT_LOAD (0x1)
41 # ELF-X86-64-NEXT: Offset: 0x0
42 # ELF-X86-64-NEXT: VirtualAddress: 0x400000
43 # ELF-X86-64-NEXT: PhysicalAddress: 0x400000
44 # ELF-X86-64-NEXT: FileSize: 312
45 # ELF-X86-64-NEXT: MemSize: 312
46 # ELF-X86-64-NEXT: Flags [ (0x5)
47 # ELF-X86-64-NEXT: PF_R (0x4)
48 # ELF-X86-64-NEXT: PF_X (0x1)
50 # ELF-X86-64-NEXT: Alignment: 2097152
52 # ELF-X86-64-NEXT: ProgramHeader {
53 # ELF-X86-64-NEXT: Type: PT_GNU_EH_FRAME (0x6474E550)
54 # ELF-X86-64-NEXT: Offset: 0xF4
55 # ELF-X86-64-NEXT: VirtualAddress: 0x4000F4
56 # ELF-X86-64-NEXT: PhysicalAddress: 0x4000F4
57 # ELF-X86-64-NEXT: FileSize: 20
58 # ELF-X86-64-NEXT: MemSize: 20
59 # ELF-X86-64-NEXT: Flags [ (0x4)
60 # ELF-X86-64-NEXT: PF_R (0x4)
62 # ELF-X86-64-NEXT: Alignment: 4
64 # ELF-X86-64-NEXT: ProgramHeader {
65 # ELF-X86-64-NEXT: Type: PT_GNU_STACK (0x6474E551)
66 # ELF-X86-64-NEXT: Offset: 0x0
67 # ELF-X86-64-NEXT: VirtualAddress: 0x0
68 # ELF-X86-64-NEXT: PhysicalAddress: 0x0
69 # ELF-X86-64-NEXT: FileSize: 0
70 # ELF-X86-64-NEXT: MemSize: 0
71 # ELF-X86-64-NEXT: Flags [ (0x6)
72 # ELF-X86-64-NEXT: PF_R (0x4)
73 # ELF-X86-64-NEXT: PF_W (0x2)
75 # ELF-X86-64-NEXT: Alignment: 8
79 # RUN: llvm-readobj -l %p/../../Object/Inputs/program-headers.mips \
80 # RUN: | FileCheck %s -check-prefix ELF-MIPS
82 # ELF-MIPS: Format: ELF32-mips
83 # ELF-MIPS-NEXT: Arch: mips
84 # ELF-MIPS-NEXT: AddressSize: 32bit
85 # ELF-MIPS-NEXT: LoadName:
86 # ELF-MIPS-NEXT: ProgramHeaders [
87 # ELF-MIPS-NEXT: ProgramHeader {
88 # ELF-MIPS-NEXT: Type: PT_MIPS_ABIFLAGS (0x70000003)
89 # ELF-MIPS-NEXT: Offset: 0x98
90 # ELF-MIPS-NEXT: VirtualAddress: 0x400098
91 # ELF-MIPS-NEXT: PhysicalAddress: 0x400098
92 # ELF-MIPS-NEXT: FileSize: 24
93 # ELF-MIPS-NEXT: MemSize: 24
94 # ELF-MIPS-NEXT: Flags [ (0x4)
95 # ELF-MIPS-NEXT: PF_R (0x4)
97 # ELF-MIPS-NEXT: Alignment: 8
99 # ELF-MIPS-NEXT: ProgramHeader {
100 # ELF-MIPS-NEXT: Type: PT_MIPS_REGINFO (0x70000000)
101 # ELF-MIPS-NEXT: Offset: 0xB0
102 # ELF-MIPS-NEXT: VirtualAddress: 0x4000B0
103 # ELF-MIPS-NEXT: PhysicalAddress: 0x4000B0
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: 4
111 # ELF-MIPS-NEXT: ProgramHeader {
112 # ELF-MIPS-NEXT: Type: PT_LOAD (0x1)
113 # ELF-MIPS-NEXT: Offset: 0x0
114 # ELF-MIPS-NEXT: VirtualAddress: 0x400000
115 # ELF-MIPS-NEXT: PhysicalAddress: 0x400000
116 # ELF-MIPS-NEXT: FileSize: 224
117 # ELF-MIPS-NEXT: MemSize: 224
118 # ELF-MIPS-NEXT: Flags [ (0x5)
119 # ELF-MIPS-NEXT: PF_R (0x4)
120 # ELF-MIPS-NEXT: PF_X (0x1)
122 # ELF-MIPS-NEXT: Alignment: 65536
126 # RUN: llvm-readobj -l %p/../../Object/Inputs/program-headers.mips64 \
127 # RUN: | FileCheck %s -check-prefix ELF-MIPS64
129 # ELF-MIPS64: Format: ELF64-mips
130 # ELF-MIPS64-NEXT: Arch: mips64
131 # ELF-MIPS64-NEXT: AddressSize: 64bit
132 # ELF-MIPS64-NEXT: LoadName:
133 # ELF-MIPS64-NEXT: ProgramHeaders [
134 # ELF-MIPS64-NEXT: ProgramHeader {
135 # ELF-MIPS64-NEXT: Type: PT_LOAD (0x1)
136 # ELF-MIPS64-NEXT: Offset: 0x0
137 # ELF-MIPS64-NEXT: VirtualAddress: 0x120000000
138 # ELF-MIPS64-NEXT: PhysicalAddress: 0x120000000
139 # ELF-MIPS64-NEXT: FileSize: 136
140 # ELF-MIPS64-NEXT: MemSize: 136
141 # ELF-MIPS64-NEXT: Flags [ (0x5)
142 # ELF-MIPS64-NEXT: PF_R (0x4)
143 # ELF-MIPS64-NEXT: PF_X (0x1)
145 # ELF-MIPS64-NEXT: Alignment: 65536
149 ## Test that llvm-readobj dumps OpenBSD specific program headers.
151 # RUN: yaml2obj %s -o %t
152 # RUN: llvm-readobj -l %t | FileCheck %s --check-prefix=OPENBSD-X86-64
154 # OPENBSD-X86-64: ProgramHeader {
155 # OPENBSD-X86-64-NEXT: Type: PT_OPENBSD_RANDOMIZE
156 # OPENBSD-X86-64: ProgramHeader {
157 # OPENBSD-X86-64-NEXT: Type: PT_OPENBSD_WXNEEDED
158 # OPENBSD-X86-64: ProgramHeader {
159 # OPENBSD-X86-64-NEXT: Type: PT_OPENBSD_BOOTDATA
168 - Type: 0x65a3dbe6 ## PT_OPENBSD_RANDOMIZE
169 - Type: 0x65a3dbe7 ## PT_OPENBSD_WXNEEDED
170 - Type: 0x65a41be6 ## PT_OPENBSD_BOOTDATA