• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1## Check yaml2obj is able to set an ABI version for an object.
2
3## Check that by default yaml2obj emits ELFOSABI_NONE (0) for ABI version.
4# RUN: yaml2obj %s --docnum=1 -o %t.default
5# RUN: yaml2obj %s --docnum=2 -o %t.none
6# RUN: llvm-readobj --file-headers %t.none | FileCheck %s --check-prefix=OSABI-NONE
7# RUN: llvm-readobj --file-headers %t.default | FileCheck %s --check-prefix=OSABI-NONE
8
9# OSABI-NONE: OS/ABI: SystemV (0x0)
10
11--- !ELF
12FileHeader:
13  Class: ELFCLASS64
14  Data:  ELFDATA2LSB
15  Type:  ET_REL
16  OSABI: ELFOSABI_NONE
17
18--- !ELF
19FileHeader:
20  Class: ELFCLASS64
21  Data:  ELFDATA2LSB
22  Type:  ET_REL
23
24# RUN: yaml2obj %s --docnum=3 -o %t.hpux
25# RUN: llvm-readobj --file-headers %t.hpux | FileCheck %s --check-prefix=OSABI-HPUX
26
27# OSABI-HPUX: OS/ABI: HPUX (0x1)
28
29--- !ELF
30FileHeader:
31  Class: ELFCLASS64
32  Data:  ELFDATA2LSB
33  Type:  ET_REL
34  OSABI: ELFOSABI_HPUX
35
36# RUN: yaml2obj %s --docnum=4 -o %t.netbsd
37# RUN: llvm-readobj --file-headers %t.netbsd | FileCheck %s --check-prefix=OSABI-NETBSD
38
39# OSABI-NETBSD: OS/ABI: NetBSD (0x2)
40
41--- !ELF
42FileHeader:
43  Class: ELFCLASS64
44  Data:  ELFDATA2LSB
45  Type:  ET_REL
46  OSABI: ELFOSABI_NETBSD
47
48## Test ELFOSABI_GNU and ELFOSABI_LINUX (historical alias for ELFOSABI_GNU).
49# RUN: yaml2obj %s --docnum=5 -o %t.gnu
50# RUN: llvm-readobj --file-headers %t.gnu | FileCheck %s --check-prefix=OSABI-GNU
51# RUN: yaml2obj %s --docnum=6 -o %t.gnu.alias
52# RUN: llvm-readobj --file-headers %t.gnu.alias | FileCheck %s --check-prefix=OSABI-GNU
53# OSABI-GNU: OS/ABI: GNU/Linux (0x3)
54
55--- !ELF
56FileHeader:
57  Class: ELFCLASS64
58  Data:  ELFDATA2LSB
59  Type:  ET_REL
60  OSABI: ELFOSABI_GNU
61
62--- !ELF
63FileHeader:
64  Class: ELFCLASS64
65  Data:  ELFDATA2LSB
66  Type:  ET_REL
67  OSABI: ELFOSABI_LINUX
68
69# RUN: yaml2obj %s --docnum=7 -o %t.hurd
70# RUN: llvm-readobj --file-headers %t.hurd | FileCheck %s --check-prefix=OSABI-HURD
71
72# OSABI-HURD: OS/ABI: GNU/Hurd (0x4)
73
74--- !ELF
75FileHeader:
76  Class: ELFCLASS64
77  Data:  ELFDATA2LSB
78  Type:  ET_REL
79  OSABI: ELFOSABI_HURD
80
81# RUN: yaml2obj %s --docnum=8 -o %t.solaris
82# RUN: llvm-readobj --file-headers %t.solaris | FileCheck %s --check-prefix=OSABI-SOLARIS
83
84# OSABI-SOLARIS: OS/ABI: Solaris (0x6)
85
86--- !ELF
87FileHeader:
88  Class: ELFCLASS64
89  Data:  ELFDATA2LSB
90  Type:  ET_REL
91  OSABI: ELFOSABI_SOLARIS
92
93# RUN: yaml2obj %s --docnum=9 -o %t.aix
94# RUN: llvm-readobj --file-headers %t.aix | FileCheck %s --check-prefix=OSABI-AIX
95
96# OSABI-AIX: OS/ABI: AIX (0x7)
97
98--- !ELF
99FileHeader:
100  Class: ELFCLASS64
101  Data:  ELFDATA2LSB
102  Type:  ET_REL
103  OSABI: ELFOSABI_AIX
104
105# RUN: yaml2obj %s --docnum=10 -o %t.irix
106# RUN: llvm-readobj --file-headers %t.irix | FileCheck %s --check-prefix=OSABI-IRIX
107
108# OSABI-IRIX: OS/ABI: IRIX (0x8)
109
110--- !ELF
111FileHeader:
112  Class: ELFCLASS64
113  Data:  ELFDATA2LSB
114  Type:  ET_REL
115  OSABI: ELFOSABI_IRIX
116
117# RUN: yaml2obj %s --docnum=11 -o %t.freebsd
118# RUN: llvm-readobj --file-headers %t.freebsd | FileCheck %s --check-prefix=OSABI-FREEBSD
119
120# OSABI-FREEBSD: OS/ABI: FreeBSD (0x9)
121
122--- !ELF
123FileHeader:
124  Class: ELFCLASS64
125  Data:  ELFDATA2LSB
126  Type:  ET_REL
127  OSABI: ELFOSABI_FREEBSD
128
129# RUN: yaml2obj %s --docnum=12 -o %t.tru64
130# RUN: llvm-readobj --file-headers %t.tru64 | FileCheck %s --check-prefix=OSABI-TRU64
131
132# OSABI-TRU64: OS/ABI: TRU64 (0xA)
133
134--- !ELF
135FileHeader:
136  Class: ELFCLASS64
137  Data:  ELFDATA2LSB
138  Type:  ET_REL
139  OSABI: ELFOSABI_TRU64
140
141# RUN: yaml2obj %s --docnum=13 -o %t.modesto
142# RUN: llvm-readobj --file-headers %t.modesto | FileCheck %s --check-prefix=OSABI-MODESTO
143
144# OSABI-MODESTO: OS/ABI: Modesto (0xB)
145
146--- !ELF
147FileHeader:
148  Class: ELFCLASS64
149  Data:  ELFDATA2LSB
150  Type:  ET_REL
151  OSABI: ELFOSABI_MODESTO
152
153# RUN: yaml2obj %s --docnum=14 -o %t.openbsd
154# RUN: llvm-readobj --file-headers %t.openbsd | FileCheck %s --check-prefix=OSABI-OPENBSD
155
156# OSABI-OPENBSD: OS/ABI: OpenBSD (0xC)
157
158--- !ELF
159FileHeader:
160  Class: ELFCLASS64
161  Data:  ELFDATA2LSB
162  Type:  ET_REL
163  OSABI: ELFOSABI_OPENBSD
164
165# RUN: yaml2obj %s --docnum=15 -o %t.openvms
166# RUN: llvm-readobj --file-headers %t.openvms | FileCheck %s --check-prefix=OSABI-OPENVMS
167
168# OSABI-OPENVMS: OS/ABI: OpenVMS (0xD)
169
170--- !ELF
171FileHeader:
172  Class: ELFCLASS64
173  Data:  ELFDATA2LSB
174  Type:  ET_REL
175  OSABI: ELFOSABI_OPENVMS
176
177# RUN: yaml2obj %s --docnum=16 -o %t.nsk
178# RUN: llvm-readobj --file-headers %t.nsk | FileCheck %s --check-prefix=OSABI-NSK
179
180# OSABI-NSK: OS/ABI: NSK (0xE)
181
182--- !ELF
183FileHeader:
184  Class: ELFCLASS64
185  Data:  ELFDATA2LSB
186  Type:  ET_REL
187  OSABI: ELFOSABI_NSK
188
189# RUN: yaml2obj %s --docnum=17 -o %t.aros
190# RUN: llvm-readobj --file-headers %t.aros | FileCheck %s --check-prefix=OSABI-AROS
191
192# OSABI-AROS: OS/ABI: AROS (0xF)
193
194--- !ELF
195FileHeader:
196  Class: ELFCLASS64
197  Data:  ELFDATA2LSB
198  Type:  ET_REL
199  OSABI: ELFOSABI_AROS
200
201# RUN: yaml2obj %s --docnum=18 -o %t.fenixos
202# RUN: llvm-readobj --file-headers %t.fenixos | FileCheck %s --check-prefix=OSABI-FENIXOS
203
204# OSABI-FENIXOS: OS/ABI: FenixOS (0x10)
205
206--- !ELF
207FileHeader:
208  Class: ELFCLASS64
209  Data:  ELFDATA2LSB
210  Type:  ET_REL
211  OSABI: ELFOSABI_FENIXOS
212
213# RUN: yaml2obj %s --docnum=19 -o %t.cloudabi
214# RUN: llvm-readobj --file-headers %t.cloudabi | FileCheck %s --check-prefix=OSABI-CLOUDABI
215
216# OSABI-CLOUDABI: OS/ABI: CloudABI (0x11)
217
218--- !ELF
219FileHeader:
220  Class: ELFCLASS64
221  Data:  ELFDATA2LSB
222  Type:  ET_REL
223  OSABI: ELFOSABI_CLOUDABI
224
225# RUN: yaml2obj %s --docnum=20 -o %t.amdhsa
226# RUN: llvm-readobj --file-headers %t.amdhsa | FileCheck %s --check-prefix=OSABI-ARCHSPEC40
227# RUN: yaml2obj %s --docnum=21 -o %t.c6000
228# RUN: llvm-readobj --file-headers %t.c6000 | FileCheck %s --check-prefix=OSABI-ARCHSPEC40
229
230# OSABI-ARCHSPEC40: OS/ABI: 0x40
231
232--- !ELF
233FileHeader:
234  Class: ELFCLASS64
235  Data:  ELFDATA2LSB
236  Type:  ET_REL
237  OSABI: ELFOSABI_AMDGPU_HSA
238
239--- !ELF
240FileHeader:
241  Class: ELFCLASS64
242  Data:  ELFDATA2LSB
243  Type:  ET_REL
244  OSABI: ELFOSABI_C6000_ELFABI
245
246# RUN: yaml2obj %s --docnum=22 -o %t.amdpal
247# RUN: llvm-readobj --file-headers %t.amdpal | FileCheck %s --check-prefix=OSABI-ARCHSPEC41
248# RUN: yaml2obj %s --docnum=23 -o %t.c6000linux
249# RUN: llvm-readobj --file-headers %t.c6000linux | FileCheck %s --check-prefix=OSABI-ARCHSPEC41
250
251# OSABI-ARCHSPEC41: OS/ABI: 0x41
252
253--- !ELF
254FileHeader:
255  Class: ELFCLASS64
256  Data:  ELFDATA2LSB
257  Type:  ET_REL
258  OSABI: ELFOSABI_AMDGPU_PAL
259
260--- !ELF
261FileHeader:
262  Class: ELFCLASS64
263  Data:  ELFDATA2LSB
264  Type:  ET_REL
265  OSABI: ELFOSABI_C6000_LINUX
266
267# RUN: yaml2obj %s --docnum=24 -o %t.amdmesa
268# RUN: llvm-readobj --file-headers %t.amdmesa | FileCheck %s --check-prefix=OSABI-AMD-MESA3D
269
270# OSABI-AMD-MESA3D: OS/ABI: 0x42
271
272--- !ELF
273FileHeader:
274  Class: ELFCLASS64
275  Data:  ELFDATA2LSB
276  Type:  ET_REL
277  OSABI: ELFOSABI_AMDGPU_MESA3D
278
279# RUN: yaml2obj %s --docnum=25 -o %t.arm
280# RUN: llvm-readobj --file-headers %t.arm | FileCheck %s --check-prefix=OSABI-ARM
281
282# OSABI-ARM: OS/ABI: 0x61
283
284--- !ELF
285FileHeader:
286  Class: ELFCLASS64
287  Data:  ELFDATA2LSB
288  Type:  ET_REL
289  OSABI: ELFOSABI_ARM
290
291# RUN: yaml2obj %s --docnum=26 -o %t.standalone
292# RUN: llvm-readobj --file-headers %t.standalone | FileCheck %s --check-prefix=OSABI-STANDALONE
293
294# OSABI-STANDALONE: OS/ABI: Standalone (0xFF)
295
296--- !ELF
297FileHeader:
298  Class: ELFCLASS64
299  Data:  ELFDATA2LSB
300  Type:  ET_REL
301  OSABI: ELFOSABI_STANDALONE
302
303## Test we can use an arbitrary number for OSABI.
304# RUN: yaml2obj %s --docnum=27 -o %t.number
305# RUN: llvm-readobj --file-headers %t.number | FileCheck %s --check-prefix=OSABI-NUMBER
306# OSABI-NUMBER: OS/ABI: 0xFE
307
308--- !ELF
309FileHeader:
310  Class: ELFCLASS64
311  Data:  ELFDATA2LSB
312  Type:  ET_REL
313  OSABI: 0xFE
314