19#ifndef LLVM_BINARYFORMAT_ELF_H
20#define LLVM_BINARYFORMAT_ELF_H
45static const char ElfMagic[] = {0x7f,
'E',
'L',
'F',
'\0'};
386#define ELF_RELOC(name, value) name = value,
390#include "ELFRelocs/x86_64.def"
395#include "ELFRelocs/i386.def"
400#include "ELFRelocs/PowerPC.def"
419 return ((1 << Val) >> 2) << 2;
424#include "ELFRelocs/PowerPC64.def"
429#include "ELFRelocs/AArch64.def"
456#include "ELFRelocs/ARM.def"
477#include "ELFRelocs/ARC.def"
509#include "ELFRelocs/AVR.def"
585#include "ELFRelocs/Mips.def"
666#include "ELFRelocs/Hexagon.def"
671#include "ELFRelocs/Lanai.def"
688#include "ELFRelocs/RISCV.def"
699#include "ELFRelocs/SystemZ.def"
725#include "ELFRelocs/Sparc.def"
891#include "ELFRelocs/AMDGPU.def"
939#include "ELFRelocs/BPF.def"
944#include "ELFRelocs/M68k.def"
976#include "ELFRelocs/MSP430.def"
981#include "ELFRelocs/VE.def"
1004#include "ELFRelocs/CSKY.def"
1027#include "ELFRelocs/LoongArch.def"
1042#include "ELFRelocs/Xtensa.def"
1311 st_info = (b << 4) + (t & 0x0f);
1331 st_info = (b << 4) + (t & 0x0f);
1573#define DYNAMIC_TAG(name, value) DT_##name = value,
1574#include "DynamicTags.def"
Merge contiguous icmps into a memcmp
StringRef - Represent a constant reference to a string, i.e.
StringRef convertOSABIToName(uint8_t OSABI)
@ STO_AARCH64_VARIANT_PCS
static int64_t decodePPC64LocalEntryOffset(unsigned Other)
constexpr const char * ELF_NOTE_GNU
@ RHS_NO_LIBRARY_REPLACEMENT
@ RHF_GUARANTEE_START_INIT
@ EF_AVR_LINKRELAX_PREPARED
@ RELOCATION_GROUPED_BY_OFFSET_DELTA_FLAG
@ RELOCATION_GROUPED_BY_INFO_FLAG
@ RELOCATION_GROUPED_BY_ADDEND_FLAG
@ RELOCATION_GROUP_HAS_ADDEND_FLAG
static const char ElfMagic[]
@ SHT_LLVM_BB_ADDR_MAP_V0
@ SHT_AARCH64_MEMTAG_GLOBALS_DYNAMIC
@ SHT_LLVM_DEPENDENT_LIBRARIES
@ SHT_LLVM_LINKER_OPTIONS
@ SHT_AARCH64_MEMTAG_GLOBALS_STATIC
@ SHT_LLVM_CALL_GRAPH_PROFILE
@ EF_AMDGPU_GENERIC_VERSION_MAX
@ EF_AMDGPU_FEATURE_XNACK_ANY_V4
@ EF_AMDGPU_MACH_AMDGCN_GFX703
@ EF_AMDGPU_MACH_AMDGCN_GFX1035
@ EF_AMDGPU_FEATURE_SRAMECC_V3
@ EF_AMDGPU_MACH_AMDGCN_GFX1031
@ EF_AMDGPU_GENERIC_VERSION_OFFSET
@ EF_AMDGPU_MACH_R600_CAYMAN
@ EF_AMDGPU_FEATURE_SRAMECC_UNSUPPORTED_V4
@ EF_AMDGPU_MACH_AMDGCN_RESERVED_0X56
@ EF_AMDGPU_MACH_AMDGCN_GFX704
@ EF_AMDGPU_MACH_AMDGCN_RESERVED_0X57
@ EF_AMDGPU_MACH_AMDGCN_GFX902
@ EF_AMDGPU_MACH_AMDGCN_GFX810
@ EF_AMDGPU_MACH_AMDGCN_GFX950
@ EF_AMDGPU_MACH_AMDGCN_LAST
@ EF_AMDGPU_MACH_AMDGCN_GFX1036
@ EF_AMDGPU_MACH_AMDGCN_GFX1102
@ EF_AMDGPU_MACH_R600_RESERVED_LAST
@ EF_AMDGPU_MACH_R600_RV730
@ EF_AMDGPU_MACH_R600_RV710
@ EF_AMDGPU_MACH_AMDGCN_GFX908
@ EF_AMDGPU_MACH_AMDGCN_GFX1011
@ EF_AMDGPU_MACH_R600_CYPRESS
@ EF_AMDGPU_MACH_AMDGCN_GFX1032
@ EF_AMDGPU_MACH_R600_R600
@ EF_AMDGPU_MACH_AMDGCN_GFX940
@ EF_AMDGPU_MACH_AMDGCN_GFX941
@ EF_AMDGPU_MACH_R600_TURKS
@ EF_AMDGPU_MACH_R600_JUNIPER
@ EF_AMDGPU_FEATURE_SRAMECC_OFF_V4
@ EF_AMDGPU_FEATURE_XNACK_UNSUPPORTED_V4
@ EF_AMDGPU_MACH_AMDGCN_GFX601
@ EF_AMDGPU_MACH_AMDGCN_GFX942
@ EF_AMDGPU_MACH_R600_LAST
@ EF_AMDGPU_MACH_R600_RESERVED_FIRST
@ EF_AMDGPU_MACH_AMDGCN_GFX1152
@ EF_AMDGPU_MACH_AMDGCN_RESERVED_0X27
@ EF_AMDGPU_FEATURE_TRAP_HANDLER_V2
@ EF_AMDGPU_MACH_R600_R630
@ EF_AMDGPU_MACH_R600_REDWOOD
@ EF_AMDGPU_MACH_AMDGCN_FIRST
@ EF_AMDGPU_MACH_R600_RV770
@ EF_AMDGPU_FEATURE_XNACK_OFF_V4
@ EF_AMDGPU_MACH_AMDGCN_GFX600
@ EF_AMDGPU_FEATURE_XNACK_V3
@ EF_AMDGPU_MACH_AMDGCN_GFX602
@ EF_AMDGPU_MACH_AMDGCN_GFX1101
@ EF_AMDGPU_MACH_AMDGCN_GFX1100
@ EF_AMDGPU_MACH_AMDGCN_GFX1033
@ EF_AMDGPU_MACH_AMDGCN_GFX801
@ EF_AMDGPU_FEATURE_XNACK_V4
@ EF_AMDGPU_MACH_AMDGCN_GFX705
@ EF_AMDGPU_MACH_AMDGCN_GFX9_4_GENERIC
@ EF_AMDGPU_MACH_AMDGCN_GFX1153
@ EF_AMDGPU_MACH_AMDGCN_GFX1010
@ EF_AMDGPU_MACH_R600_RV670
@ EF_AMDGPU_MACH_AMDGCN_GFX701
@ EF_AMDGPU_GENERIC_VERSION_MIN
@ EF_AMDGPU_MACH_AMDGCN_GFX10_3_GENERIC
@ EF_AMDGPU_MACH_AMDGCN_GFX1012
@ EF_AMDGPU_MACH_AMDGCN_GFX1151
@ EF_AMDGPU_MACH_AMDGCN_GFX1030
@ EF_AMDGPU_MACH_R600_CEDAR
@ EF_AMDGPU_MACH_AMDGCN_GFX1200
@ EF_AMDGPU_MACH_AMDGCN_GFX700
@ EF_AMDGPU_MACH_AMDGCN_RESERVED_0X4D
@ EF_AMDGPU_MACH_AMDGCN_GFX11_GENERIC
@ EF_AMDGPU_MACH_AMDGCN_GFX803
@ EF_AMDGPU_MACH_AMDGCN_GFX802
@ EF_AMDGPU_MACH_AMDGCN_GFX90C
@ EF_AMDGPU_MACH_AMDGCN_RESERVED_0X50
@ EF_AMDGPU_FEATURE_SRAMECC_V4
@ EF_AMDGPU_FEATURE_XNACK_ON_V4
@ EF_AMDGPU_MACH_AMDGCN_GFX900
@ EF_AMDGPU_MACH_AMDGCN_GFX909
@ EF_AMDGPU_MACH_AMDGCN_GFX906
@ EF_AMDGPU_MACH_AMDGCN_GFX9_GENERIC
@ EF_AMDGPU_MACH_AMDGCN_GFX1103
@ EF_AMDGPU_MACH_R600_CAICOS
@ EF_AMDGPU_MACH_AMDGCN_GFX90A
@ EF_AMDGPU_MACH_AMDGCN_GFX1034
@ EF_AMDGPU_MACH_AMDGCN_GFX1013
@ EF_AMDGPU_MACH_AMDGCN_GFX12_GENERIC
@ EF_AMDGPU_MACH_AMDGCN_GFX10_1_GENERIC
@ EF_AMDGPU_MACH_AMDGCN_GFX904
@ EF_AMDGPU_MACH_R600_RS880
@ EF_AMDGPU_MACH_R600_FIRST
@ EF_AMDGPU_MACH_AMDGCN_GFX805
@ EF_AMDGPU_MACH_AMDGCN_GFX1201
@ EF_AMDGPU_MACH_AMDGCN_GFX1150
@ EF_AMDGPU_MACH_R600_SUMO
@ EF_AMDGPU_MACH_R600_BARTS
@ EF_AMDGPU_FEATURE_SRAMECC_ANY_V4
@ EF_AMDGPU_FEATURE_XNACK_V2
@ EF_AMDGPU_FEATURE_SRAMECC_ON_V4
@ EF_AMDGPU_MACH_AMDGCN_RESERVED_0X49
@ EF_AMDGPU_MACH_AMDGCN_GFX702
@ EF_AMDGPU_GENERIC_VERSION
@ EF_LOONGARCH_OBJABI_MASK
@ EF_LOONGARCH_ABI_SINGLE_FLOAT
@ EF_LOONGARCH_ABI_DOUBLE_FLOAT
@ EF_LOONGARCH_ABI_SOFT_FLOAT
@ EF_LOONGARCH_ABI_MODIFIER_MASK
@ ELFABIVERSION_AMDGPU_HSA_V4
@ ELFABIVERSION_AMDGPU_HSA_V5
@ ELFABIVERSION_AMDGPU_HSA_V3
@ ELFABIVERSION_AMDGPU_HSA_V6
@ ELFABIVERSION_AMDGPU_HSA_V2
@ NT_NETBSDCORE_LWPSTATUS
@ NT_ARM_TAGGED_ADDR_CTRL
@ EF_RISCV_FLOAT_ABI_SOFT
@ EF_RISCV_FLOAT_ABI_SINGLE
@ EF_RISCV_FLOAT_ABI_DOUBLE
@ EF_RISCV_FLOAT_ABI_QUAD
constexpr unsigned CREL_HDR_ADDEND
@ NT_LLVM_OPENMP_OFFLOAD_PRODUCER
@ NT_LLVM_OPENMP_OFFLOAD_VERSION
@ NT_LLVM_OPENMP_OFFLOAD_PRODUCER_VERSION
@ NT_FREEBSD_PROCSTAT_PROC
@ NT_FREEBSD_PROCSTAT_UMASK
@ NT_FREEBSD_PROCSTAT_FILES
@ NT_FREEBSD_PROCSTAT_GROUPS
@ NT_FREEBSD_PROCSTAT_OSREL
@ NT_FREEBSD_PROCSTAT_RLIMIT
@ NT_FREEBSD_PROCSTAT_AUXV
@ NT_FREEBSD_PROCSTAT_PSSTRINGS
@ NT_FREEBSD_PROCSTAT_VMMAP
@ GNU_PROPERTY_AARCH64_FEATURE_1_BTI
@ GNU_PROPERTY_AARCH64_FEATURE_1_PAC
@ GNU_PROPERTY_AARCH64_FEATURE_1_GCS
@ AARCH64_PAUTH_PLATFORM_LLVM_LINUX
@ AARCH64_PAUTH_PLATFORM_INVALID
@ AARCH64_PAUTH_PLATFORM_BAREMETAL
@ XCORE_SHF_DP_SECTION
All sections with the "d" flag are grouped together by the linker to form the data section and the dp...
@ XCORE_SHF_CP_SECTION
All sections with the "c" flag are grouped together by the linker to form the constant pool and the c...
@ NT_FREEBSD_FCTL_STKGAP_DISABLE
@ NT_FREEBSD_FCTL_ASG_DISABLE
@ NT_FREEBSD_FCTL_WXNEEDED
@ NT_FREEBSD_FCTL_ASLR_DISABLE
@ NT_FREEBSD_FCTL_PROTMAX_DISABLE
@ NT_GNU_BUILD_ATTRIBUTE_OPEN
@ NT_GNU_BUILD_ATTRIBUTE_FUNC
uint16_t convertArchNameToEMachine(StringRef Arch)
Convert an architecture name into ELF's e_machine value.
@ GNU_PROPERTY_NO_COPY_ON_PROTECTED
@ GNU_PROPERTY_X86_UINT32_OR_LO
@ GNU_PROPERTY_X86_FEATURE_1_AND
@ GNU_PROPERTY_X86_UINT32_OR_AND_LO
@ GNU_PROPERTY_X86_ISA_1_NEEDED
@ GNU_PROPERTY_X86_ISA_1_USED
@ GNU_PROPERTY_X86_FEATURE_2_USED
@ GNU_PROPERTY_X86_FEATURE_2_NEEDED
@ GNU_PROPERTY_AARCH64_FEATURE_PAUTH
@ GNU_PROPERTY_STACK_SIZE
@ GNU_PROPERTY_AARCH64_FEATURE_1_AND
@ EF_MSP430_MACH_MSP430x42
@ EF_MSP430_MACH_MSP430x24
@ EF_MSP430_MACH_MSP430x46
@ EF_MSP430_MACH_MSP430x31
@ EF_MSP430_MACH_MSP430x43
@ EF_MSP430_MACH_MSP430x14
@ EF_MSP430_MACH_MSP430x26
@ EF_MSP430_MACH_MSP430x23
@ EF_MSP430_MACH_MSP430x20
@ EF_MSP430_MACH_MSP430x11
@ EF_MSP430_MACH_MSP430x41
@ EF_MSP430_MACH_MSP430x16
@ EF_MSP430_MACH_MSP430x33
@ EF_MSP430_MACH_MSP430x12
@ EF_MSP430_MACH_MSP430x44
@ EF_MSP430_MACH_MSP430x32
@ EF_MSP430_MACH_MSP430x22
@ EF_MSP430_MACH_MSP430x47
@ EF_MSP430_MACH_MSP430x15
@ EF_MSP430_MACH_MSP430x13
@ EF_MSP430_MACH_MSP430x54
@ EF_MSP430_MACH_MSP430x11x1
StringRef convertEMachineToArchName(uint16_t EMachine)
Convert an ELF's e_machine value into an architecture name.
@ AARCH64_PAUTH_PLATFORM_LLVM_LINUX_VERSION_INITFINIADDRDISC
@ AARCH64_PAUTH_PLATFORM_LLVM_LINUX_VERSION_FPTRTYPEDISCR
@ AARCH64_PAUTH_PLATFORM_LLVM_LINUX_VERSION_VPTRADDRDISCR
@ AARCH64_PAUTH_PLATFORM_LLVM_LINUX_VERSION_AUTHTRAPS
@ AARCH64_PAUTH_PLATFORM_LLVM_LINUX_VERSION_GOTOS
@ AARCH64_PAUTH_PLATFORM_LLVM_LINUX_VERSION_INITFINI
@ AARCH64_PAUTH_PLATFORM_LLVM_LINUX_VERSION_INTRINSICS
@ AARCH64_PAUTH_PLATFORM_LLVM_LINUX_VERSION_RETURNS
@ AARCH64_PAUTH_PLATFORM_LLVM_LINUX_VERSION_VPTRTYPEDISCR
@ AARCH64_PAUTH_PLATFORM_LLVM_LINUX_VERSION_LAST
@ AARCH64_PAUTH_PLATFORM_LLVM_LINUX_VERSION_TYPEINFOVPTRDISCR
@ AARCH64_PAUTH_PLATFORM_LLVM_LINUX_VERSION_GOT
@ AARCH64_PAUTH_PLATFORM_LLVM_LINUX_VERSION_CALLS
@ GNU_PROPERTY_X86_FEATURE_1_SHSTK
@ GNU_PROPERTY_X86_FEATURE_2_ZMM
@ GNU_PROPERTY_X86_FEATURE_2_FXSR
@ GNU_PROPERTY_X86_FEATURE_2_X86
@ GNU_PROPERTY_X86_ISA_1_V4
@ GNU_PROPERTY_X86_ISA_1_BASELINE
@ GNU_PROPERTY_X86_ISA_1_V2
@ GNU_PROPERTY_X86_FEATURE_2_XSAVEOPT
@ GNU_PROPERTY_X86_FEATURE_2_XMM
@ GNU_PROPERTY_X86_FEATURE_2_YMM
@ GNU_PROPERTY_X86_FEATURE_2_XSAVE
@ GNU_PROPERTY_X86_ISA_1_V3
@ GNU_PROPERTY_X86_FEATURE_2_X87
@ GNU_PROPERTY_X86_FEATURE_2_MMX
@ GNU_PROPERTY_X86_FEATURE_2_XSAVEC
@ GNU_PROPERTY_X86_FEATURE_1_IBT
uint8_t convertNameToOSABI(StringRef Name)
@ EF_CUDA_TEXMODE_INDEPENDANT
@ EF_CUDA_TEXMODE_UNIFIED
@ NT_AMD_HSA_CODE_OBJECT_VERSION
This is an optimization pass for GlobalISel generic memory operations.
union llvm::ELF::Elf32_Dyn::@141 d_un
unsigned char e_ident[EI_NIDENT]
unsigned char getFileClass() const
unsigned char getDataEncoding() const
void setType(unsigned char t)
unsigned char getType() const
void setSymbolAndType(Elf32_Word s, unsigned char t)
Elf32_Word getSymbol() const
void setSymbol(Elf32_Word s)
void setType(unsigned char t)
Elf32_Word getSymbol() const
void setSymbol(Elf32_Word s)
void setSymbolAndType(Elf32_Word s, unsigned char t)
unsigned char getType() const
void setBinding(unsigned char b)
void setType(unsigned char t)
unsigned char getType() const
void setBindingAndType(unsigned char b, unsigned char t)
unsigned char getBinding() const
union llvm::ELF::Elf64_Dyn::@142 d_un
unsigned char getFileClass() const
unsigned char e_ident[EI_NIDENT]
unsigned char getDataEncoding() const
void setType(Elf64_Word t)
void setSymbol(Elf64_Word s)
Elf64_Word getType() const
Elf64_Word getSymbol() const
void setSymbolAndType(Elf64_Word s, Elf64_Word t)
Elf64_Word getType() const
void setSymbolAndType(Elf64_Word s, Elf64_Word t)
void setSymbol(Elf64_Word s)
Elf64_Word getSymbol() const
void setType(Elf64_Word t)
void setBinding(unsigned char b)
void setType(unsigned char t)
void setBindingAndType(unsigned char b, unsigned char t)
unsigned char getType() const
unsigned char getBinding() const
std::conditional_t< Is64, uint64_t, uint32_t > r_offset
std::conditional_t< Is64, int64_t, int32_t > r_addend