Path: blob/main/contrib/elftoolchain/libelftc/libelftc_bfdtarget.c
39483 views
/*-1* Copyright (c) 2008,2009 Kai Wang2* All rights reserved.3*4* Redistribution and use in source and binary forms, with or without5* modification, are permitted provided that the following conditions6* are met:7* 1. Redistributions of source code must retain the above copyright8* notice, this list of conditions and the following disclaimer9* in this position and unchanged.10* 2. Redistributions in binary form must reproduce the above copyright11* notice, this list of conditions and the following disclaimer in the12* documentation and/or other materials provided with the distribution.13*14* THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS OR15* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES16* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.17* IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY DIRECT, INDIRECT,18* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT19* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,20* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY21* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT22* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF23* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.24*/2526#include <sys/param.h>27#include <libelf.h>28#include <libelftc.h>2930#include "_libelftc.h"3132ELFTC_VCSID("$Id: libelftc_bfdtarget.c 3752 2019-06-28 01:12:53Z emaste $");3334struct _Elftc_Bfd_Target _libelftc_targets[] = {3536{37.bt_name = "binary",38.bt_type = ETF_BINARY,39},4041{42.bt_name = "elf32-avr",43.bt_type = ETF_ELF,44.bt_byteorder = ELFDATA2LSB,45.bt_elfclass = ELFCLASS32,46.bt_machine = EM_AVR,47},4849{50.bt_name = "elf32-big",51.bt_type = ETF_ELF,52.bt_byteorder = ELFDATA2MSB,53.bt_elfclass = ELFCLASS32,54},5556{57.bt_name = "elf32-bigarm",58.bt_type = ETF_ELF,59.bt_byteorder = ELFDATA2MSB,60.bt_elfclass = ELFCLASS32,61.bt_machine = EM_ARM,62},6364{65.bt_name = "elf32-bigmips",66.bt_type = ETF_ELF,67.bt_byteorder = ELFDATA2MSB,68.bt_elfclass = ELFCLASS32,69.bt_machine = EM_MIPS,70},7172{73.bt_name = "elf32-i386",74.bt_type = ETF_ELF,75.bt_byteorder = ELFDATA2LSB,76.bt_elfclass = ELFCLASS32,77.bt_machine = EM_386,78},7980{81.bt_name = "elf32-i386-freebsd",82.bt_type = ETF_ELF,83.bt_byteorder = ELFDATA2LSB,84.bt_elfclass = ELFCLASS32,85.bt_machine = EM_386,86.bt_osabi = ELFOSABI_FREEBSD,87},8889{90.bt_name = "elf32-ia64-big",91.bt_type = ETF_ELF,92.bt_byteorder = ELFDATA2MSB,93.bt_elfclass = ELFCLASS32,94.bt_machine = EM_IA_64,95},9697{98.bt_name = "elf32-little",99.bt_type = ETF_ELF,100.bt_byteorder = ELFDATA2LSB,101.bt_elfclass = ELFCLASS32,102},103104{105.bt_name = "elf32-littlearm",106.bt_type = ETF_ELF,107.bt_byteorder = ELFDATA2LSB,108.bt_elfclass = ELFCLASS32,109.bt_machine = EM_ARM,110},111112{113.bt_name = "elf32-littlemips",114.bt_type = ETF_ELF,115.bt_byteorder = ELFDATA2LSB,116.bt_elfclass = ELFCLASS32,117.bt_machine = EM_MIPS,118},119120{121.bt_name = "elf32-powerpc",122.bt_type = ETF_ELF,123.bt_byteorder = ELFDATA2MSB,124.bt_elfclass = ELFCLASS32,125.bt_machine = EM_PPC,126},127128{129.bt_name = "elf32-powerpc-freebsd",130.bt_type = ETF_ELF,131.bt_byteorder = ELFDATA2MSB,132.bt_elfclass = ELFCLASS32,133.bt_machine = EM_PPC,134.bt_osabi = ELFOSABI_FREEBSD,135},136137{138.bt_name = "elf32-powerpcle",139.bt_type = ETF_ELF,140.bt_byteorder = ELFDATA2LSB,141.bt_elfclass = ELFCLASS32,142.bt_machine = EM_PPC,143},144145{146.bt_name = "elf32-sh",147.bt_type = ETF_ELF,148.bt_byteorder = ELFDATA2MSB,149.bt_elfclass = ELFCLASS32,150.bt_machine = EM_SH,151},152153{154.bt_name = "elf32-shl",155.bt_type = ETF_ELF,156.bt_byteorder = ELFDATA2LSB,157.bt_elfclass = ELFCLASS32,158.bt_machine = EM_SH,159},160161{162.bt_name = "elf32-sh-nbsd",163.bt_type = ETF_ELF,164.bt_byteorder = ELFDATA2MSB,165.bt_elfclass = ELFCLASS32,166.bt_machine = EM_SH,167.bt_osabi = ELFOSABI_NETBSD,168},169170{171.bt_name = "elf32-shl-nbsd",172.bt_type = ETF_ELF,173.bt_byteorder = ELFDATA2LSB,174.bt_elfclass = ELFCLASS32,175.bt_machine = EM_SH,176.bt_osabi = ELFOSABI_NETBSD,177},178179{180.bt_name = "elf32-shbig-linux",181.bt_type = ETF_ELF,182.bt_byteorder = ELFDATA2MSB,183.bt_elfclass = ELFCLASS32,184.bt_machine = EM_SH,185.bt_osabi = ELFOSABI_LINUX,186},187188{189.bt_name = "elf32-sh-linux",190.bt_type = ETF_ELF,191.bt_byteorder = ELFDATA2LSB,192.bt_elfclass = ELFCLASS32,193.bt_machine = EM_SH,194.bt_osabi = ELFOSABI_LINUX,195},196197{198.bt_name = "elf32-sparc",199.bt_type = ETF_ELF,200.bt_byteorder = ELFDATA2MSB,201.bt_elfclass = ELFCLASS32,202.bt_machine = EM_SPARC,203},204205{206.bt_name = "elf32-tradbigmips",207.bt_type = ETF_ELF,208.bt_byteorder = ELFDATA2MSB,209.bt_elfclass = ELFCLASS32,210.bt_machine = EM_MIPS,211},212213{214.bt_name = "elf32-tradlittlemips",215.bt_type = ETF_ELF,216.bt_byteorder = ELFDATA2LSB,217.bt_elfclass = ELFCLASS32,218.bt_machine = EM_MIPS,219},220221{222.bt_name = "elf64-alpha",223.bt_type = ETF_ELF,224.bt_byteorder = ELFDATA2LSB,225.bt_elfclass = ELFCLASS64,226.bt_machine = EM_ALPHA,227},228229{230.bt_name = "elf64-alpha-freebsd",231.bt_type = ETF_ELF,232.bt_byteorder = ELFDATA2LSB,233.bt_elfclass = ELFCLASS64,234.bt_machine = EM_ALPHA,235.bt_osabi = ELFOSABI_FREEBSD236},237238{239.bt_name = "elf64-big",240.bt_type = ETF_ELF,241.bt_byteorder = ELFDATA2MSB,242.bt_elfclass = ELFCLASS64,243},244245{246.bt_name = "elf64-bigmips",247.bt_type = ETF_ELF,248.bt_byteorder = ELFDATA2MSB,249.bt_elfclass = ELFCLASS64,250.bt_machine = EM_MIPS,251},252253{254.bt_name = "elf64-ia64-big",255.bt_type = ETF_ELF,256.bt_byteorder = ELFDATA2MSB,257.bt_elfclass = ELFCLASS64,258.bt_machine = EM_IA_64,259},260261{262.bt_name = "elf64-ia64-little",263.bt_type = ETF_ELF,264.bt_byteorder = ELFDATA2LSB,265.bt_elfclass = ELFCLASS64,266.bt_machine = EM_IA_64,267},268269{270.bt_name = "elf64-little",271.bt_type = ETF_ELF,272.bt_byteorder = ELFDATA2LSB,273.bt_elfclass = ELFCLASS64,274},275276{277.bt_name = "elf64-littleaarch64",278.bt_type = ETF_ELF,279.bt_byteorder = ELFDATA2LSB,280.bt_elfclass = ELFCLASS64,281.bt_machine = EM_AARCH64,282},283284{285.bt_name = "elf64-littlemips",286.bt_type = ETF_ELF,287.bt_byteorder = ELFDATA2LSB,288.bt_elfclass = ELFCLASS64,289.bt_machine = EM_MIPS,290},291292{293.bt_name = "elf64-powerpc",294.bt_type = ETF_ELF,295.bt_byteorder = ELFDATA2MSB,296.bt_elfclass = ELFCLASS64,297.bt_machine = EM_PPC64,298},299300{301.bt_name = "elf64-powerpc-freebsd",302.bt_type = ETF_ELF,303.bt_byteorder = ELFDATA2MSB,304.bt_elfclass = ELFCLASS64,305.bt_machine = EM_PPC64,306.bt_osabi = ELFOSABI_FREEBSD,307},308309{310.bt_name = "elf64-powerpcle",311.bt_type = ETF_ELF,312.bt_byteorder = ELFDATA2LSB,313.bt_elfclass = ELFCLASS64,314.bt_machine = EM_PPC64,315},316317{318.bt_name = "elf32-riscv",319.bt_type = ETF_ELF,320.bt_byteorder = ELFDATA2LSB,321.bt_elfclass = ELFCLASS32,322.bt_machine = EM_RISCV,323},324325{326.bt_name = "elf64-riscv",327.bt_type = ETF_ELF,328.bt_byteorder = ELFDATA2LSB,329.bt_elfclass = ELFCLASS64,330.bt_machine = EM_RISCV,331},332333{334.bt_name = "elf64-riscv-freebsd",335.bt_type = ETF_ELF,336.bt_byteorder = ELFDATA2LSB,337.bt_elfclass = ELFCLASS64,338.bt_machine = EM_RISCV,339.bt_osabi = ELFOSABI_FREEBSD,340},341342{343.bt_name = "elf32-loongarch",344.bt_type = ETF_ELF,345.bt_byteorder = ELFDATA2LSB,346.bt_elfclass = ELFCLASS32,347.bt_machine = EM_LOONGARCH,348},349350{351.bt_name = "elf64-loongarch",352.bt_type = ETF_ELF,353.bt_byteorder = ELFDATA2LSB,354.bt_elfclass = ELFCLASS64,355.bt_machine = EM_LOONGARCH,356},357358{359.bt_name = "elf64-loongarch-freebsd",360.bt_type = ETF_ELF,361.bt_byteorder = ELFDATA2LSB,362.bt_elfclass = ELFCLASS64,363.bt_machine = EM_LOONGARCH,364.bt_osabi = ELFOSABI_FREEBSD,365},366367{368.bt_name = "elf64-sh64",369.bt_type = ETF_ELF,370.bt_byteorder = ELFDATA2MSB,371.bt_elfclass = ELFCLASS64,372.bt_machine = EM_SH,373},374375{376.bt_name = "elf64-sh64l",377.bt_type = ETF_ELF,378.bt_byteorder = ELFDATA2LSB,379.bt_elfclass = ELFCLASS64,380.bt_machine = EM_SH,381},382383{384.bt_name = "elf64-sh64-nbsd",385.bt_type = ETF_ELF,386.bt_byteorder = ELFDATA2MSB,387.bt_elfclass = ELFCLASS64,388.bt_machine = EM_SH,389.bt_osabi = ELFOSABI_NETBSD,390},391392{393.bt_name = "elf64-sh64l-nbsd",394.bt_type = ETF_ELF,395.bt_byteorder = ELFDATA2LSB,396.bt_elfclass = ELFCLASS64,397.bt_machine = EM_SH,398.bt_osabi = ELFOSABI_NETBSD,399},400401{402.bt_name = "elf64-sh64big-linux",403.bt_type = ETF_ELF,404.bt_byteorder = ELFDATA2MSB,405.bt_elfclass = ELFCLASS64,406.bt_machine = EM_SH,407.bt_osabi = ELFOSABI_LINUX,408},409410{411.bt_name = "elf64-sh64-linux",412.bt_type = ETF_ELF,413.bt_byteorder = ELFDATA2LSB,414.bt_elfclass = ELFCLASS64,415.bt_machine = EM_SH,416.bt_osabi = ELFOSABI_LINUX,417},418419{420.bt_name = "elf64-sparc",421.bt_type = ETF_ELF,422.bt_byteorder = ELFDATA2MSB,423.bt_elfclass = ELFCLASS64,424.bt_machine = EM_SPARCV9,425},426427{428.bt_name = "elf64-sparc-freebsd",429.bt_type = ETF_ELF,430.bt_byteorder = ELFDATA2MSB,431.bt_elfclass = ELFCLASS64,432.bt_machine = EM_SPARCV9,433.bt_osabi = ELFOSABI_FREEBSD434},435436{437.bt_name = "elf64-tradbigmips",438.bt_type = ETF_ELF,439.bt_byteorder = ELFDATA2MSB,440.bt_elfclass = ELFCLASS64,441.bt_machine = EM_MIPS,442},443444{445.bt_name = "elf64-tradlittlemips",446.bt_type = ETF_ELF,447.bt_byteorder = ELFDATA2LSB,448.bt_elfclass = ELFCLASS64,449.bt_machine = EM_MIPS,450},451452{453.bt_name = "elf64-x86-64",454.bt_type = ETF_ELF,455.bt_byteorder = ELFDATA2LSB,456.bt_elfclass = ELFCLASS64,457.bt_machine = EM_X86_64,458},459460{461.bt_name = "elf64-x86-64-freebsd",462.bt_type = ETF_ELF,463.bt_byteorder = ELFDATA2LSB,464.bt_elfclass = ELFCLASS64,465.bt_machine = EM_X86_64,466.bt_osabi = ELFOSABI_FREEBSD467},468469{470.bt_name = "ihex",471.bt_type = ETF_IHEX,472},473474{475.bt_name = "srec",476.bt_type = ETF_SREC,477},478479{480.bt_name = "symbolsrec",481.bt_type = ETF_SREC,482},483484{485.bt_name = "efi-app-ia32",486.bt_type = ETF_EFI,487.bt_machine = EM_386,488},489490{491.bt_name = "efi-app-x86_64",492.bt_type = ETF_EFI,493.bt_machine = EM_X86_64,494},495496{497.bt_name = "efi-app-loongarch64",498.bt_type = ETF_EFI,499.bt_machine = EM_LOONGARCH,500},501502{503.bt_name = "pei-i386",504.bt_type = ETF_PE,505.bt_machine = EM_386,506},507508{509.bt_name = "pei-x86-64",510.bt_type = ETF_PE,511.bt_machine = EM_X86_64,512},513514{515.bt_name = NULL,516.bt_type = ETF_NONE,517},518};519520521