2 * Copyright (c) 2008,2009 Kai Wang
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer
10 * in this position and unchanged.
11 * 2. Redistributions in binary form must reproduce the above copyright
12 * notice, this list of conditions and the following disclaimer in the
13 * documentation and/or other materials provided with the distribution.
15 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS OR
16 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
17 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
18 * IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY DIRECT, INDIRECT,
19 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
20 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
21 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
22 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
23 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
24 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 #include <sys/param.h>
31 #include "_libelftc.h"
33 ELFTC_VCSID("$Id: libelftc_bfdtarget.c 3516 2017-02-10 02:33:08Z emaste $");
35 struct _Elftc_Bfd_Target _libelftc_targets[] = {
39 .bt_type = ETF_BINARY,
43 .bt_name = "elf32-avr",
45 .bt_byteorder = ELFDATA2LSB,
46 .bt_elfclass = ELFCLASS32,
51 .bt_name = "elf32-big",
53 .bt_byteorder = ELFDATA2MSB,
54 .bt_elfclass = ELFCLASS32,
58 .bt_name = "elf32-bigarm",
60 .bt_byteorder = ELFDATA2MSB,
61 .bt_elfclass = ELFCLASS32,
66 .bt_name = "elf32-bigmips",
68 .bt_byteorder = ELFDATA2MSB,
69 .bt_elfclass = ELFCLASS32,
70 .bt_machine = EM_MIPS,
74 .bt_name = "elf32-i386",
76 .bt_byteorder = ELFDATA2LSB,
77 .bt_elfclass = ELFCLASS32,
82 .bt_name = "elf32-i386-freebsd",
84 .bt_byteorder = ELFDATA2LSB,
85 .bt_elfclass = ELFCLASS32,
87 .bt_osabi = ELFOSABI_FREEBSD,
91 .bt_name = "elf32-ia64-big",
93 .bt_byteorder = ELFDATA2MSB,
94 .bt_elfclass = ELFCLASS32,
95 .bt_machine = EM_IA_64,
99 .bt_name = "elf32-little",
101 .bt_byteorder = ELFDATA2LSB,
102 .bt_elfclass = ELFCLASS32,
106 .bt_name = "elf32-littlearm",
108 .bt_byteorder = ELFDATA2LSB,
109 .bt_elfclass = ELFCLASS32,
110 .bt_machine = EM_ARM,
114 .bt_name = "elf32-littlemips",
116 .bt_byteorder = ELFDATA2LSB,
117 .bt_elfclass = ELFCLASS32,
118 .bt_machine = EM_MIPS,
122 .bt_name = "elf32-powerpc",
124 .bt_byteorder = ELFDATA2MSB,
125 .bt_elfclass = ELFCLASS32,
126 .bt_machine = EM_PPC,
130 .bt_name = "elf32-powerpc-freebsd",
132 .bt_byteorder = ELFDATA2MSB,
133 .bt_elfclass = ELFCLASS32,
134 .bt_machine = EM_PPC,
135 .bt_osabi = ELFOSABI_FREEBSD,
139 .bt_name = "elf32-powerpcle",
141 .bt_byteorder = ELFDATA2LSB,
142 .bt_elfclass = ELFCLASS32,
143 .bt_machine = EM_PPC,
147 .bt_name = "elf32-sh",
149 .bt_byteorder = ELFDATA2MSB,
150 .bt_elfclass = ELFCLASS32,
155 .bt_name = "elf32-shl",
157 .bt_byteorder = ELFDATA2LSB,
158 .bt_elfclass = ELFCLASS32,
163 .bt_name = "elf32-sh-nbsd",
165 .bt_byteorder = ELFDATA2MSB,
166 .bt_elfclass = ELFCLASS32,
168 .bt_osabi = ELFOSABI_NETBSD,
172 .bt_name = "elf32-shl-nbsd",
174 .bt_byteorder = ELFDATA2LSB,
175 .bt_elfclass = ELFCLASS32,
177 .bt_osabi = ELFOSABI_NETBSD,
181 .bt_name = "elf32-shbig-linux",
183 .bt_byteorder = ELFDATA2MSB,
184 .bt_elfclass = ELFCLASS32,
186 .bt_osabi = ELFOSABI_LINUX,
190 .bt_name = "elf32-sh-linux",
192 .bt_byteorder = ELFDATA2LSB,
193 .bt_elfclass = ELFCLASS32,
195 .bt_osabi = ELFOSABI_LINUX,
199 .bt_name = "elf32-sparc",
201 .bt_byteorder = ELFDATA2MSB,
202 .bt_elfclass = ELFCLASS32,
203 .bt_machine = EM_SPARC,
207 .bt_name = "elf32-tradbigmips",
209 .bt_byteorder = ELFDATA2MSB,
210 .bt_elfclass = ELFCLASS32,
211 .bt_machine = EM_MIPS,
215 .bt_name = "elf32-tradlittlemips",
217 .bt_byteorder = ELFDATA2LSB,
218 .bt_elfclass = ELFCLASS32,
219 .bt_machine = EM_MIPS,
223 .bt_name = "elf64-alpha",
225 .bt_byteorder = ELFDATA2LSB,
226 .bt_elfclass = ELFCLASS64,
227 .bt_machine = EM_ALPHA,
231 .bt_name = "elf64-alpha-freebsd",
233 .bt_byteorder = ELFDATA2LSB,
234 .bt_elfclass = ELFCLASS64,
235 .bt_machine = EM_ALPHA,
236 .bt_osabi = ELFOSABI_FREEBSD
240 .bt_name = "elf64-big",
242 .bt_byteorder = ELFDATA2MSB,
243 .bt_elfclass = ELFCLASS64,
247 .bt_name = "elf64-bigmips",
249 .bt_byteorder = ELFDATA2MSB,
250 .bt_elfclass = ELFCLASS64,
251 .bt_machine = EM_MIPS,
255 .bt_name = "elf64-ia64-big",
257 .bt_byteorder = ELFDATA2MSB,
258 .bt_elfclass = ELFCLASS64,
259 .bt_machine = EM_IA_64,
263 .bt_name = "elf64-ia64-little",
265 .bt_byteorder = ELFDATA2LSB,
266 .bt_elfclass = ELFCLASS64,
267 .bt_machine = EM_IA_64,
271 .bt_name = "elf64-little",
273 .bt_byteorder = ELFDATA2LSB,
274 .bt_elfclass = ELFCLASS64,
278 .bt_name = "elf64-littleaarch64",
280 .bt_byteorder = ELFDATA2LSB,
281 .bt_elfclass = ELFCLASS64,
282 .bt_machine = EM_AARCH64,
286 .bt_name = "elf64-littlemips",
288 .bt_byteorder = ELFDATA2LSB,
289 .bt_elfclass = ELFCLASS64,
290 .bt_machine = EM_MIPS,
294 .bt_name = "elf64-powerpc",
296 .bt_byteorder = ELFDATA2MSB,
297 .bt_elfclass = ELFCLASS64,
298 .bt_machine = EM_PPC64,
302 .bt_name = "elf64-powerpc-freebsd",
304 .bt_byteorder = ELFDATA2MSB,
305 .bt_elfclass = ELFCLASS64,
306 .bt_machine = EM_PPC64,
307 .bt_osabi = ELFOSABI_FREEBSD,
311 .bt_name = "elf64-powerpcle",
313 .bt_byteorder = ELFDATA2LSB,
314 .bt_elfclass = ELFCLASS64,
315 .bt_machine = EM_PPC64,
319 .bt_name = "elf64-sh64",
321 .bt_byteorder = ELFDATA2MSB,
322 .bt_elfclass = ELFCLASS64,
327 .bt_name = "elf64-sh64l",
329 .bt_byteorder = ELFDATA2LSB,
330 .bt_elfclass = ELFCLASS64,
335 .bt_name = "elf64-sh64-nbsd",
337 .bt_byteorder = ELFDATA2MSB,
338 .bt_elfclass = ELFCLASS64,
340 .bt_osabi = ELFOSABI_NETBSD,
344 .bt_name = "elf64-sh64l-nbsd",
346 .bt_byteorder = ELFDATA2LSB,
347 .bt_elfclass = ELFCLASS64,
349 .bt_osabi = ELFOSABI_NETBSD,
353 .bt_name = "elf64-sh64big-linux",
355 .bt_byteorder = ELFDATA2MSB,
356 .bt_elfclass = ELFCLASS64,
358 .bt_osabi = ELFOSABI_LINUX,
362 .bt_name = "elf64-sh64-linux",
364 .bt_byteorder = ELFDATA2LSB,
365 .bt_elfclass = ELFCLASS64,
367 .bt_osabi = ELFOSABI_LINUX,
371 .bt_name = "elf64-sparc",
373 .bt_byteorder = ELFDATA2MSB,
374 .bt_elfclass = ELFCLASS64,
375 .bt_machine = EM_SPARCV9,
379 .bt_name = "elf64-sparc-freebsd",
381 .bt_byteorder = ELFDATA2MSB,
382 .bt_elfclass = ELFCLASS64,
383 .bt_machine = EM_SPARCV9,
384 .bt_osabi = ELFOSABI_FREEBSD
388 .bt_name = "elf64-tradbigmips",
390 .bt_byteorder = ELFDATA2MSB,
391 .bt_elfclass = ELFCLASS64,
392 .bt_machine = EM_MIPS,
396 .bt_name = "elf64-tradlittlemips",
398 .bt_byteorder = ELFDATA2LSB,
399 .bt_elfclass = ELFCLASS64,
400 .bt_machine = EM_MIPS,
404 .bt_name = "elf64-x86-64",
406 .bt_byteorder = ELFDATA2LSB,
407 .bt_elfclass = ELFCLASS64,
408 .bt_machine = EM_X86_64,
412 .bt_name = "elf64-x86-64-freebsd",
414 .bt_byteorder = ELFDATA2LSB,
415 .bt_elfclass = ELFCLASS64,
416 .bt_machine = EM_X86_64,
417 .bt_osabi = ELFOSABI_FREEBSD
431 .bt_name = "symbolsrec",
436 .bt_name = "efi-app-ia32",
438 .bt_machine = EM_386,
442 .bt_name = "efi-app-x86_64",
444 .bt_machine = EM_X86_64,
448 .bt_name = "pei-i386",
450 .bt_machine = EM_386,
454 .bt_name = "pei-x86-64",
456 .bt_machine = EM_X86_64,