L4Re Operating System Framework
Interface and Usage Documentation
All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
ELF binary format

Functions and types related to ELF binaries. More...

+ Collaboration diagram for ELF binary format:

Files

file  elf.h
 ELF definition.
 

Data Structures

struct  Elf32_Ehdr
 ELF32 header. More...
 
struct  Elf64_Ehdr
 ELF64 header. More...
 
struct  Elf32_Shdr
 ELF32 section header. More...
 
struct  Elf64_Shdr
 ELF64 section header. More...
 
struct  Elf32_Phdr
 ELF32 program header. More...
 
struct  Elf64_Phdr
 ELF64 program header. More...
 
struct  Elf32_Dyn
 ELF32 dynamic entry. More...
 
struct  Elf64_Dyn
 ELF64 dynamic entry. More...
 
struct  Elf32_Rel
 ELF32 relocation entry w/o addend. More...
 
struct  Elf32_Rela
 ELF32 relocation entry w/ addend. More...
 
struct  Elf64_Rel
 ELF64 relocation entry w/o addend. More...
 
struct  Elf64_Rela
 ELF64 relocation entry w/ addend. More...
 
struct  Elf32_Sym
 ELF32 symbol table entry. More...
 
struct  Elf64_Sym
 ELF64 symbol table entry. More...
 
struct  Elf32_Auxv
 Auxiliary vector (32-bit). More...
 
struct  Elf64_Auxv
 Auxiliary vector (64-bit). More...
 

Macros

#define ElfW(type)   _ElfW(Elf, 32, type)
 Use 64 or 32 bits types depending on the target architecture.
 
#define ELF32_R_SYM(i)   ((i)>>8)
 Symbol table index.
 
#define ELF32_R_TYPE(i)   ((unsigned char)(i))
 
#define ELF32_R_INFO(s, t)   (((s)<<8)+(unsigned char)(t))
 Create info from symbol table index + type.
 
#define ELF64_R_SYM(i)   ((i)>>32)
 Symbol table index.
 
#define ELF64_R_TYPE(i)   ((i)&0xffffffffL)
 
#define ELF64_R_INFO(s, t)   (((s)<<32)+(t)&0xffffffffL)
 Create info from symbol table index + type.
 
#define ELF32_ST_BIND(i)   ((i)>>4)
 
#define ELF32_ST_TYPE(i)   ((i)&0xf)
 
#define ELF32_ST_INFO(b, t)   (((b)<<4)+((t)&0xf))
 Make info from bind + type.
 
#define ELF64_ST_BIND(i)   ((i)>>4)
 
#define ELF64_ST_TYPE(i)   ((i)&0xf)
 
#define ELF64_ST_INFO(b, t)   (((b)<<4)+((t)&0xf))
 Make info from bind + type.
 

Typedefs

typedef struct Elf32_Auxv Elf32_Auxv
 Auxiliary vector (32-bit).
 
typedef struct Elf64_Auxv Elf64_Auxv
 Auxiliary vector (64-bit).
 

Enumerations

enum  { EI_NIDENT = 16 }
 
enum  Elf_ETs {
  ET_NONE = 0 , ET_REL = 1 , ET_EXEC = 2 , ET_DYN = 3 ,
  ET_CORE = 4 , ET_LOPROC = 0xff00 , ET_HIPROC = 0xffff
}
 Object file type. More...
 
enum  Elf_EMs {
  EM_NONE = 0 , EM_M32 = 1 , EM_SPARC = 2 , EM_386 = 3 ,
  EM_68K = 4 , EM_88K = 5 , EM_860 = 7 , EM_MIPS = 8 ,
  EM_MIPS_RS4_BE = 10 , EM_SPARC64 = 11 , EM_PARISC = 15 , EM_VPP500 = 17 ,
  EM_SPARC32PLUS = 18 , EM_960 = 19 , EM_PPC = 20 , EM_V800 = 36 ,
  EM_FR20 = 37 , EM_RH32 = 38 , EM_RCE = 39 , EM_ARM = 40 ,
  EM_ALPHA = 41 , EM_SH = 42 , EM_SPARCV9 = 43 , EM_TRICORE = 44 ,
  EM_ARC = 45 , EM_H8_300 = 46 , EM_H8_300H = 47 , EM_H8S = 48 ,
  EM_H8_500 = 49 , EM_IA_64 = 50 , EM_MIPS_X = 51 , EM_COLDFIRE = 52 ,
  EM_68HC12 = 53 , EM_X86_64 = 62 , EM_PDSP = 63 , EM_FX66 = 66 ,
  EM_ST9PLUS = 67 , EM_ST7 = 68 , EM_68HC16 = 69 , EM_68HC11 = 70 ,
  EM_68HC08 = 71 , EM_68HC05 = 72 , EM_SVX = 73 , EM_ST19 = 74 ,
  EM_VAX = 75 , EM_CRIS = 76 , EM_JAVELIN = 77 , EM_FIREPATH = 78 ,
  EM_ZSP = 79 , EM_MMIX = 80 , EM_HUANY = 81 , EM_PRISM = 82 ,
  EM_AVR = 83 , EM_FR30 = 84 , EM_D10V = 85 , EM_D30V = 86 ,
  EM_V850 = 87 , EM_M32R = 88 , EM_MN10300 = 89 , EM_MN10200 = 90 ,
  EM_PJ = 91 , EM_OPENRISC = 92 , EM_ARC_A5 = 93 , EM_XTENSA = 94 ,
  EM_ALTERA_NIOS2 = 113 , EM_AARCH64 = 183 , EM_TILEPRO = 188 , EM_MICROBLAZE = 189 ,
  EM_TILEGX = 191 , EM_RISCV = 243 , EM_NUM = 244
}
 Required architecture. More...
 
enum  Elf_EVs { EV_NONE = 0 , EV_CURRENT = 1 }
 Object file version. More...
 
enum  Elf_EIs {
  EI_MAG0 = 0 , EI_MAG1 = 1 , EI_MAG2 = 2 , EI_MAG3 = 3 ,
  EI_CLASS = 4 , EI_DATA = 5 , EI_VERSION = 6 , EI_OSABI = 7 ,
  EI_ABIVERSION = 8 , EI_PAD = 9
}
 Identification Indices. More...
 
enum  Elf_MAGs { ELFMAG0 = 0x7f , ELFMAG1 = 'E' , ELFMAG2 = 'L' , ELFMAG3 = 'F' }
 Magic number. More...
 
enum  Elf_ClASSs { ELFCLASSNONE = 0 , ELFCLASS32 = 1 , ELFCLASS64 = 2 , ELFCLASSNUM = 3 }
 File class or capacity. More...
 
enum  Elf_DATAs { ELFDATANONE = 0 , ELFDATA2LSB = 1 , ELFDATA2MSB = 2 , ELFDATANUM = 3 }
 Data encoding. More...
 
enum  Elf_OSABIs {
  ELFOSABI_NONE = 0 , ELFOSABI_SYSV = 0 , ELFOSABI_HPUX = 1 , ELFOSABI_NETBSD = 2 ,
  ELFOSABI_LINUX = 3 , ELFOSABI_SOLARIS = 6 , ELFOSABI_AIX = 7 , ELFOSABI_IRIX = 8 ,
  ELFOSABI_FREEBSD = 9 , ELFOSABI_TRU64 = 10 , ELFOSABI_MODESTO = 11 , ELFOSABI_OPENBSD = 12 ,
  ELFOSABI_ARM = 97 , ELFOSABI_STANDALONE = 255
}
 Identify operating system and ABI to which the object is targeted. More...
 
enum  Elf_SHNs {
  SHN_UNDEF = 0 , SHN_LORESERVE = 0xff00 , SHN_LOPROC = 0xff00 , SHN_HIPROC = 0xff1f ,
  SHN_ABS = 0xfff1 , SHN_COMMON = 0xfff2 , SHN_HIRESERVE = 0xffff
}
 Special section indexes. More...
 
enum  Elf_SHTs {
  SHT_NULL = 0 , SHT_PROGBITS = 1 , SHT_SYMTAB = 2 , SHT_STRTAB = 3 ,
  SHT_RELA = 4 , SHT_HASH = 5 , SHT_DYNAMIC = 6 , SHT_NOTE = 7 ,
  SHT_NOBITS = 8 , SHT_REL = 9 , SHT_SHLIB = 10 , SHT_DYNSYM = 11 ,
  SHT_INIT_ARRAY = 14 , SHT_FINI_ARRAY = 15 , SHT_PREINIT_ARRAY = 16 , SHT_GROUP = 17 ,
  SHT_SYMTAB_SHNDX = 18 , SHT_NUM = 19 , SHT_LOOS = 0x60000000 , SHT_HIOS = 0x6fffffff ,
  SHT_LOPROC = 0x70000000 , SHT_HIPROC = 0x7fffffff , SHT_LOUSER = 0x80000000 , SHT_HIUSER = 0xffffffff
}
 Section type. More...
 
enum  Elf_SHFs {
  SHF_WRITE = 0x1 , SHF_ALLOC = 0x2 , SHF_EXECINSTR = 0x4 , SHF_MERGE = 0x10 ,
  SHF_STRINGS = 0x20 , SHF_INFO_LINK = 0x40 , SHF_LINK_ORDER = 0x80 , SHF_OS_NONCONFORMING = 0x100 ,
  SHF_GROUP = 0x200 , SHF_TLS = 0x400 , SHF_MASKOS = 0x0ff00000 , SHF_MASKPROC = 0xf0000000
}
 Section attribute flags. More...
 
enum  Elf_PTs {
  PT_NULL = 0 , PT_LOAD = 1 , PT_DYNAMIC = 2 , PT_INTERP = 3 ,
  PT_NOTE = 4 , PT_SHLIB = 5 , PT_PHDR = 6 , PT_TLS = 7 ,
  PT_NUM = 8 , PT_LOOS = 0x60000000 , PT_HIOS = 0x6fffffff , PT_LOPROC = 0x70000000 ,
  PT_HIPROC = 0x7fffffff , PT_GNU_EH_FRAME = PT_LOOS + 0x474e550 , PT_GNU_STACK = PT_LOOS + 0x474e551 , PT_GNU_RELRO = PT_LOOS + 0x474e552 ,
  PT_L4_STACK = PT_LOOS + 0x12 , PT_L4_KIP = PT_LOOS + 0x13 , PT_L4_AUX = PT_LOOS + 0x14
}
 Segment types. More...
 
enum  ELF_PFs {
  PF_X = 0x1 , PF_W = 0x2 , PF_R = 0x4 , PF_MASKOS = 0x0ff00000 ,
  PF_MASKPROC = 0x7fffffff
}
 Segment permissions. More...
 
enum  Elf_NTs_core {
  NT_PRSTATUS = 1 , NT_FPREGSET = 2 , NT_PRPSINFO = 3 , NT_PRXREG = 4 ,
  NT_TASKSTRUCT = 4 , NT_PLATFORM = 5 , NT_AUXV = 6 , NT_GWINDOWS = 7 ,
  NT_ASRS = 8 , NT_PSTATUS = 10 , NT_PSINFO = 13 , NT_PRCRED = 14 ,
  NT_UTSNAME = 15 , NT_LWPSTATUS = 16 , NT_LWPSINFO = 17 , NT_PRFPXREG = 20
}
 Legal values for note segment descriptor types for core files. More...
 
enum  Elf_NTs_obj { NT_VERSION = 1 }
 Legal values for the note segment descriptor types for object files. More...
 
enum  Elf_DTs {
  DT_NULL = 0 , DT_NEEDED = 1 , DT_PLTRELSZ = 2 , DT_PLTGOT = 3 ,
  DT_HASH = 4 , DT_STRTAB = 5 , DT_SYMTAB = 6 , DT_RELA = 7 ,
  DT_RELASZ = 8 , DT_RELAENT = 9 , DT_STRSZ = 10 , DT_SYMENT = 11 ,
  DT_INIT = 12 , DT_FINI = 13 , DT_SONAME = 14 , DT_RPATH = 15 ,
  DT_SYMBOLIC = 16 , DT_REL = 17 , DT_RELSZ = 18 , DT_RELENT = 19 ,
  DT_PTRREL = 20 , DT_DEBUG = 21 , DT_TEXTREL = 22 , DT_JMPREL = 23 ,
  DT_BIND_NOW = 24 , DT_INIT_ARRAY = 25 , DT_FINI_ARRAY = 26 , DT_INIT_ARRAYSZ = 27 ,
  DT_FINI_ARRAYSZ = 28 , DT_RUNPATH = 29 , DT_FLAGS = 30 , DT_ENCODING = 32 ,
  DT_PREINIT_ARRAY = 32 , DT_PREINIT_ARRAYSZ = 33 , DT_NUM = 34 , DT_LOOS = 0x6000000d ,
  DT_HIOS = 0x6ffff000 , DT_LOPROC = 0x70000000 , DT_HIPROC = 0x7fffffff
}
 Dynamic Array Tags. More...
 
enum  Elf_DFs {
  DF_ORIGIN = 0x00000001 , DF_SYMBOLIC = 0x00000002 , DF_TEXTREL = 0x00000004 , DF_BIND_NOW = 0x00000008 ,
  DF_STATIC_TLS = 0x00000010
}
 Values of Elf32_Dyn.d_un.d_val, Elf64_Dyn.d_un.d_val in the DT_FLAGS entry. More...
 
enum  Elf_DF_1s {
  DF_1_NOW = 0x00000001 , DF_1_GLOBAL = 0x00000002 , DF_1_GROUP = 0x00000004 , DF_1_NODELETE = 0x00000008 ,
  DF_1_LOADFLTR = 0x00000010 , DF_1_INITFIRST = 0x00000020 , DF_1_NOOPEN = 0x00000040 , DF_1_ORIGIN = 0x00000080 ,
  DF_1_DIRECT = 0x00000100 , DF_1_TRANS = 0x00000200 , DF_1_INTERPOSE = 0x00000400 , DF_1_NODEFLIB = 0x00000800 ,
  DF_1_NODUMP = 0x00001000 , DF_1_CONFALT = 0x00002000 , DF_1_ENDFILTEE = 0x00004000 , DF_1_DISPRELDNE = 0x00008000 ,
  DF_1_DISPRELPND = 0x00010000
}
 State flags selectable in the Elf32_Dyn.d_un.d_val / Elf64_Dyn.d_un.d_val element of the DT_FLAGS_1 entry in the dynamic section. More...
 
enum  Elf_DTF_1s
 Flags for the feature selection in DT_FEATURE_1.
 
enum  Elf_DF_P1s { DF_P1_LAZYLOAD = 0x00000001 , DF_P1_GROUPPERM = 0x00000002 }
 Flags in the DT_POSFLAG_1 entry effecting only the next DT_* entry. More...
 
enum  Elf_R_386_s {
  R_386_NONE = 0 , R_386_32 = 1 , R_386_PC32 = 2 , R_386_GOT32 = 3 ,
  R_386_PLT32 = 4 , R_386_COPY = 5 , R_386_GLOB_DAT = 6 , R_386_JMP_SLOT = 7 ,
  R_386_RELATIVE = 8 , R_386_GOTOFF = 9 , R_386_GOTPC = 10 , R_386_32PLT = 11 ,
  R_386_TLS_TPOFF = 14 , R_386_TLS_IE = 15 , R_386_TLS_GOTIE = 16 , R_386_TLS_LE = 17 ,
  R_386_TLS_GD = 18 , R_386_TLS_LDM = 19 , R_386_16 = 20 , R_386_PC16 = 21 ,
  R_386_8 = 22 , R_386_PC8 = 23 , R_386_TLS_GD_32 = 24 , R_386_TLS_GD_PUSH = 25 ,
  R_386_TLS_GD_CALL = 26 , R_386_TLS_GD_POP = 27 , R_386_TLS_LDM_32 = 28 , R_386_TLS_LDM_PUSH = 29 ,
  R_386_TLS_LDM_CALL = 30 , R_386_TLS_LDM_POP = 31 , R_386_TLS_LDO_32 = 32 , R_386_TLS_IE_32 = 33 ,
  R_386_TLS_LE_32 = 34 , R_386_TLS_DTPMOD32 = 35 , R_386_TLS_DTPOFF32 = 36 , R_386_TLS_TPOFF32 = 37 ,
  R_386_NUM = 38
}
 Relocation types (processor specific). More...
 
enum  Elf_EF_ARM_s { }
 ARM specific declarations. More...
 
enum  Elf_STT_ARM_s
 Additional symbol types for Thumb.
 
enum  Elf_SHF_s_ARM { SHF_ARM_ENTRYSECT = 0x10000000 , SHF_ARM_COMDEF = 0x80000000 }
 ARM-specific values for Elf32_Shdr.sh_flags / Elf64_Shdr.sh_flags. More...
 
enum  Elf_ARM_SBs { PF_ARM_SB = 0x10000000 }
 ARM-specific program header flags. More...
 
enum  Elf_R_ARM_s {
  R_ARM_NONE = 0 , R_ARM_PC24 = 1 , R_ARM_ABS32 = 2 , R_ARM_REL32 = 3 ,
  R_ARM_PC13 = 4 , R_ARM_ABS16 = 5 , R_ARM_ABS12 = 6 , R_ARM_THM_ABS5 = 7 ,
  R_ARM_ABS8 = 8 , R_ARM_SBREL32 = 9 , R_ARM_THM_PC22 = 10 , R_ARM_THM_PC8 = 11 ,
  R_ARM_AMP_VCALL9 = 12 , R_ARM_SWI24 = 13 , R_ARM_THM_SWI8 = 14 , R_ARM_XPC25 = 15 ,
  R_ARM_THM_XPC22 = 16 , R_ARM_COPY = 20 , R_ARM_GLOB_DAT = 21 , R_ARM_JUMP_SLOT = 22 ,
  R_ARM_RELATIVE = 23 , R_ARM_GOTOFF = 24 , R_ARM_GOTPC = 25 , R_ARM_GOT32 = 26 ,
  R_ARM_PLT32 = 27 , R_ARM_ALU_PCREL_7_0 = 32 , R_ARM_ALU_PCREL_15_8 = 33 , R_ARM_ALU_PCREL_23_15 = 34 ,
  R_ARM_LDR_SBREL_11_0 = 35 , R_ARM_ALU_SBREL_19_12 = 36 , R_ARM_ALU_SBREL_27_20 = 37 , R_ARM_GNU_VTENTRY = 100 ,
  R_ARM_GNU_VTINHERIT = 101 , R_ARM_THM_PC11 = 102 , R_ARM_THM_PC9 = 103 , R_ARM_RXPC25 = 249 ,
  R_ARM_RSBREL32 = 250 , R_ARM_THM_RPC22 = 251 , R_ARM_RREL32 = 252 , R_ARM_RABS22 = 253 ,
  R_ARM_RPC24 = 254 , R_ARM_RBASE = 255 , R_ARM_NUM = 256
}
 ARM relocations. More...
 
enum  Elf_R_AARCH64_s { R_AARCH64_NONE = 0 , R_AARCH64_RELATIVE = 1027 }
 AARCH64 relocations. More...
 
enum  Elf_R_X86_64_s {
  R_X86_64_NONE = 0 , R_X86_64_64 = 1 , R_X86_64_PC32 = 2 , R_X86_64_GOT32 = 3 ,
  R_X86_64_PLT32 = 4 , R_X86_64_COPY = 5 , R_X86_64_GLOB_DAT = 6 , R_X86_64_JUMP_SLOT = 7 ,
  R_X86_64_RELATIVE = 8 , R_X86_64_GOTPCREL = 9 , R_X86_64_32 = 10 , R_X86_64_32S = 11 ,
  R_X86_64_16 = 12 , R_X86_64_PC16 = 13 , R_X86_64_8 = 14 , R_X86_64_PC8 = 15 ,
  R_X86_64_DTPMOD64 = 16 , R_X86_64_DTPOFF64 = 17 , R_X86_64_TPOFF64 = 18 , R_X86_64_TLSGD = 19 ,
  R_X86_64_TLSLD = 20 , R_X86_64_DTPOFF32 = 21 , R_X86_64_GOTTPOFF = 22 , R_X86_64_TPOFF32 = 23 ,
  R_X86_64_NUM = 24
}
 AMD x86-64 relocations. More...
 
enum  Elf_STNs
 Symbol Table Entry.
 
enum  Elf_STBs {
  STB_LOCAL = 0 , STB_GLOBAL = 1 , STB_WEAK = 2 , STB_LOOS = 10 ,
  STB_HIOS = 12 , STB_LOPROC = 13 , STB_HIPROC = 15
}
 Symbol Binding. More...
 
enum  Elf_STTs {
  STT_NOTYPE = 0 , STT_OBJECT = 1 , STT_FUNC = 2 , STT_SECTION = 3 ,
  STT_FILE = 4 , STT_LOOS = 10 , STT_HIOS = 12 , STT_LOPROC = 13 ,
  STT_HIPROC = 15
}
 Symbol Types. More...
 
enum  Elf_ATs {
  AT_NULL = 0 , AT_IGNORE = 1 , AT_EXECFD = 2 , AT_PHDR = 3 ,
  AT_PHENT = 4 , AT_PHNUM = 5 , AT_PAGESZ = 6 , AT_BASE = 7 ,
  AT_FLAGS = 8 , AT_ENTRY = 9 , AT_NOTELF = 10 , AT_UID = 11 ,
  AT_EUID = 12 , AT_GID = 13 , AT_EGID = 14 , AT_L4_AUX = 0xf0 ,
  AT_L4_ENV = 0xf1
}
 Legal values for Elf32_Auxv.atype / Elf64_Auxv.atype. More...
 

ELF types

typedef l4_uint32_t Elf32_Addr
 size 4 align 4
 
typedef l4_uint32_t Elf32_Off
 size 4 align 4
 
typedef l4_uint16_t Elf32_Half
 size 2 align 2
 
typedef l4_uint32_t Elf32_Word
 size 4 align 4
 
typedef l4_int32_t Elf32_Sword
 size 4 align 4
 
typedef l4_uint64_t Elf64_Addr
 size 8 align 8
 
typedef l4_uint64_t Elf64_Off
 size 8 align 8
 
typedef l4_uint16_t Elf64_Half
 size 2 align 2
 
typedef l4_uint32_t Elf64_Word
 size 4 align 4
 
typedef l4_int32_t Elf64_Sword
 size 4 align 4
 
typedef l4_uint64_t Elf64_Xword
 size 8 align 8
 
typedef l4_int64_t Elf64_Sxword
 size 8 align 8
 

Detailed Description

Functions and types related to ELF binaries.

Macro Definition Documentation

◆ ELF32_R_TYPE

#define ELF32_R_TYPE (   i)    ((unsigned char)(i))
See also
Elf_R_386s.

Definition at line 664 of file elf.h.

◆ ELF32_ST_BIND

#define ELF32_ST_BIND (   i)    ((i)>>4)
See also
Elf_STBs.

Definition at line 894 of file elf.h.

◆ ELF32_ST_TYPE

#define ELF32_ST_TYPE (   i)    ((i)&0xf)
See also
Elf_STTs.

Definition at line 897 of file elf.h.

◆ ELF64_R_TYPE

#define ELF64_R_TYPE (   i)    ((i)&0xffffffffL)
See also
Elf_R_386s.

Definition at line 672 of file elf.h.

◆ ELF64_ST_BIND

#define ELF64_ST_BIND (   i)    ((i)>>4)
See also
Elf_STBs

Definition at line 903 of file elf.h.

◆ ELF64_ST_TYPE

#define ELF64_ST_TYPE (   i)    ((i)&0xf)
See also
Elf_STTs

Definition at line 906 of file elf.h.

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
EI_NIDENT 

Number of characters.

Definition at line 117 of file elf.h.

◆ Elf_ARM_SBs

ARM-specific program header flags.

Enumerator
PF_ARM_SB 

Segment contains the location addressed by the static base.

Definition at line 771 of file elf.h.

◆ Elf_ATs

enum Elf_ATs

Legal values for Elf32_Auxv.atype / Elf64_Auxv.atype.

Enumerator
AT_NULL 

End of vector.

AT_IGNORE 

Entry should be ignored.

AT_EXECFD 

File descriptor of program.

AT_PHDR 

Program headers for program.

AT_PHENT 

Size of program header entry.

AT_PHNUM 

Number of program headers.

AT_PAGESZ 

System page size.

AT_BASE 

Base address of interpreter.

AT_FLAGS 

Flags.

AT_ENTRY 

Entry point of program.

AT_NOTELF 

Program is not ELF.

AT_UID 

Real UID.

AT_EUID 

Effective UID.

AT_GID 

Real GID.

AT_EGID 

Effective GID.

AT_L4_AUX 

L4Re AUX section.

AT_L4_ENV 

L4Re ENV section.

Definition at line 940 of file elf.h.

◆ Elf_ClASSs

enum Elf_ClASSs

File class or capacity.

Enumerator
ELFCLASSNONE 

Invalid class.

ELFCLASS32 

32-bit object

ELFCLASS64 

64-bit object

ELFCLASSNUM 

Mask for 32-bit or 64-bit class.

Definition at line 298 of file elf.h.

◆ Elf_DATAs

enum Elf_DATAs

Data encoding.

Enumerator
ELFDATANONE 

invalid data encoding

ELFDATA2LSB 

0x01020304 => [ 0x04|0x03|0x02|0x01 ]

ELFDATA2MSB 

0x01020304 => [ 0x01|0x02|0x03|0x04 ]

ELFDATANUM 

Mask for valid data encoding.

Definition at line 307 of file elf.h.

◆ Elf_DF_1s

enum Elf_DF_1s

State flags selectable in the Elf32_Dyn.d_un.d_val / Elf64_Dyn.d_un.d_val element of the DT_FLAGS_1 entry in the dynamic section.

Enumerator
DF_1_NOW 

Set RTLD_NOW for this object.


DF_1_GLOBAL 

Set RTLD_GLOBAL for this object.


DF_1_GROUP 

Set RTLD_GROUP for this object.


DF_1_NODELETE 

Set RTLD_NODELETE for this object.

DF_1_LOADFLTR 

Trigger filtee loading at runtime.

DF_1_INITFIRST 

Set RTLD_INITFIRST for this object.

DF_1_NOOPEN 

Set RTLD_NOOPEN for this object.


DF_1_ORIGIN 

$ORIGIN must be handled.


DF_1_DIRECT 

Direct binding enabled.


DF_1_INTERPOSE 

Object is used to interpose.


DF_1_NODEFLIB 

Ignore default lib search path.


DF_1_NODUMP 

Object can't be dldump'ed.


DF_1_CONFALT 

Configuration alternative created.

DF_1_ENDFILTEE 

Filtee terminates filters search.

DF_1_DISPRELDNE 

Disp reloc applied at build time.

DF_1_DISPRELPND 

Disp reloc applied at run-time.


Definition at line 595 of file elf.h.

◆ Elf_DF_P1s

enum Elf_DF_P1s

Flags in the DT_POSFLAG_1 entry effecting only the next DT_* entry.

Enumerator
DF_P1_LAZYLOAD 

Lazyload following object.


DF_P1_GROUPPERM 

Symbols from next object are not generally available.


Definition at line 624 of file elf.h.

◆ Elf_DFs

enum Elf_DFs

Values of Elf32_Dyn.d_un.d_val, Elf64_Dyn.d_un.d_val in the DT_FLAGS entry.

Enumerator
DF_ORIGIN 

Object may use DF_ORIGIN.

DF_SYMBOLIC 

Symbol resolutions starts here.

DF_TEXTREL 

Object contains text relocations.

DF_BIND_NOW 

No lazy binding for this object.

DF_STATIC_TLS 

Module uses the static TLS model.

Definition at line 582 of file elf.h.

◆ Elf_DTs

enum Elf_DTs

Dynamic Array Tags.

See also
Elf32_Dyn.d_tag, Elf64_Dyn.d_tag.
Enumerator
DT_NULL 

end of _DYNAMIC array

DT_NEEDED 

name of a needed library

DT_PLTRELSZ 

total size of relocation entry

DT_PLTGOT 

address assoc with prog link table

DT_HASH 

address of symbol hash table

DT_STRTAB 

address of string table

DT_SYMTAB 

address of symbol table

DT_RELA 

address of relocation table

DT_RELASZ 

total size of relocation table

DT_RELAENT 

size of DT_RELA relocation entry

DT_STRSZ 

size of the string table

DT_SYMENT 

size of a symbol table entry

DT_INIT 

address of initialization function

DT_FINI 

address of termination function

DT_SONAME 

name of the shared object

DT_RPATH 

search library path

DT_SYMBOLIC 

alter symbol resolution algorithm

DT_REL 

address of relocation table

DT_RELSZ 

total size of DT_REL relocation table

DT_RELENT 

size of the DT_REL relocation entry

DT_PTRREL 

type of relocation entry

DT_DEBUG 

for debugging purposes

DT_TEXTREL 

at least on entry changes r/o section

DT_JMPREL 

address of relocation entries

DT_BIND_NOW 

Process relocations of object.

DT_INIT_ARRAY 

Array with addresses of init fct.

DT_FINI_ARRAY 

Array with addresses of fini fct.

DT_INIT_ARRAYSZ 

Size in bytes of DT_INIT_ARRAY.

DT_FINI_ARRAYSZ 

Size in bytes of DT_FINI_ARRAY.

DT_RUNPATH 

Library search path.

DT_FLAGS 

Flags for the object being loaded.

DT_ENCODING 

Start of encoded range.

DT_PREINIT_ARRAY 

Array with addresses of preinit fct.

DT_PREINIT_ARRAYSZ 

size in bytes of DT_PREINIT_ARRAY

DT_NUM 

Number used.

DT_LOOS 

Start of OS-specific.

DT_HIOS 

End of OS-specific.

DT_LOPROC 

processor-specific

DT_HIPROC 

processor-specific

Definition at line 536 of file elf.h.

◆ Elf_EF_ARM_s

ARM specific declarations.

Processor specific flags for the ELF header e_flags field.

Enumerator
EF_ARM_ALIGN8 

8-bit structure alignment is in use

Definition at line 731 of file elf.h.

◆ Elf_EIs

enum Elf_EIs

Identification Indices.

See also
Elf32_Ehdr.e_ident, Elf64_Ehdr.e_ident
Enumerator
EI_MAG0 

file id 0

EI_MAG1 

file id 1

EI_MAG2 

file id 2

EI_MAG3 

file id 3

EI_CLASS 

file class

EI_DATA 

data encoding

EI_VERSION 

file version

EI_OSABI 

Operating system / ABI identification.

EI_ABIVERSION 

ABI version.

EI_PAD 

start of padding bytes

Definition at line 274 of file elf.h.

◆ Elf_EMs

enum Elf_EMs

Required architecture.

See also
Elf32_Ehdr.e_machine, Elf64_Ehdr.e_machine
Enumerator
EM_NONE 

no machine

EM_M32 

AT&T WE 32100.

EM_SPARC 

SPARC.

EM_386 

Intel 80386.

EM_68K 

Motorola 68000.

EM_88K 

Motorola 88000.

EM_860 

Intel 80860.

EM_MIPS 

MIPS RS3000 big-endian.

EM_MIPS_RS4_BE 

MIPS RS4000 big-endian.

EM_SPARC64 

SPARC 64-bit.

EM_PARISC 

HP PA-RISC.

EM_VPP500 

Fujitsu VPP500.

EM_SPARC32PLUS 

Sun's V8plus.

EM_960 

Intel 80960.

EM_PPC 

PowerPC.

EM_V800 

NEC V800.

EM_FR20 

Fujitsu FR20.

EM_RH32 

TRW RH-32.

EM_RCE 

Motorola RCE.

EM_ARM 

Advanced RISC Machines ARM.

EM_ALPHA 

Digital Alpha.

EM_SH 

Hitachi SuperH.

EM_SPARCV9 

SPARC v9 64-bit.

EM_TRICORE 

Siemens Tricore embedded processor.

EM_ARC 

Argonaut RISC Core, Argonaut Techn Inc.

EM_H8_300 

Hitachi H8/300.

EM_H8_300H 

Hitachi H8/300H.

EM_H8S 

Hitachi H8/S.

EM_H8_500 

Hitachi H8/500.

EM_IA_64 

HP/Intel IA-64.

EM_MIPS_X 

Stanford MIPS-X.

EM_COLDFIRE 

Motorola Coldfire.

EM_68HC12 

Motorola M68HC12.

EM_X86_64 

Advanced Micro Devices x86-64.

EM_PDSP 

Sony DSP Processor.

EM_FX66 

Siemens FX66 microcontroller.

EM_ST9PLUS 

STMicroelectronics ST9+ 8/16 mc.

EM_ST7 

STmicroelectronics ST7 8 bit mc.

EM_68HC16 

Motorola MC68HC16 microcontroller.

EM_68HC11 

Motorola MC68HC11 microcontroller.

EM_68HC08 

Motorola MC68HC08 microcontroller.

EM_68HC05 

Motorola MC68HC05 microcontroller.

EM_SVX 

Silicon Graphics SVx.

EM_ST19 

STMicroelectronics ST19 8 bit mc.

EM_VAX 

Digital VAX.

EM_CRIS 

Axis Communications 32-bit embedded processor.

EM_JAVELIN 

Infineon Technologies 32-bit embedded processor.

EM_FIREPATH 

Element 14 64-bit DSP Processor.

EM_ZSP 

LSI Logic 16-bit DSP Processor.

EM_MMIX 

Donald Knuth's educational 64-bit processor.

EM_HUANY 

Harvard University machine-independent object files.

EM_PRISM 

SiTera Prism.

EM_AVR 

Atmel AVR 8-bit microcontroller.

EM_FR30 

Fujitsu FR30.

EM_D10V 

Mitsubishi D10V.

EM_D30V 

Mitsubishi D30V.

EM_V850 

NEC v850.

EM_M32R 

Mitsubishi M32R.

EM_MN10300 

Matsushita MN10300.

EM_MN10200 

Matsushita MN10200.

EM_PJ 

picoJava

EM_OPENRISC 

OpenRISC 32-bit embedded processor.

EM_ARC_A5 

ARC Cores Tangent-A5.

EM_XTENSA 

Tensilica Xtensa Architecture.

EM_ALTERA_NIOS2 

Altera Nios II.

EM_AARCH64 

ARM AARCH64.

EM_TILEPRO 

Tilera TILEPro.

EM_MICROBLAZE 

Xilinx MicroBlaze.

EM_TILEGX 

Tilera TILE-Gx.

EM_RISCV 

RISC-V.

Definition at line 183 of file elf.h.

◆ Elf_ETs

enum Elf_ETs

Object file type.

See also
Elf32_Ehdr.e_type, Elf64_Ehdr.e_type
Enumerator
ET_NONE 

no file type

ET_REL 

relocatable file

ET_EXEC 

executable file

ET_DYN 

shared object file

ET_CORE 

core file

ET_LOPROC 

processor-specific

ET_HIPROC 

processor-specific

Definition at line 168 of file elf.h.

◆ Elf_EVs

enum Elf_EVs

Object file version.

See also
Elf32_Ehdr.e_version, Elf64_Ehdr.e_version
Enumerator
EV_NONE 

Invalid version.

EV_CURRENT 

Current version.

Definition at line 266 of file elf.h.

◆ Elf_MAGs

enum Elf_MAGs

Magic number.

Enumerator
ELFMAG0 

e_ident[EI_MAG0]

ELFMAG1 

e_ident[EI_MAG1]

ELFMAG2 

e_ident[EI_MAG2]

ELFMAG3 

e_ident[EI_MAG3]

Definition at line 289 of file elf.h.

◆ Elf_NTs_core

Legal values for note segment descriptor types for core files.

Enumerator
NT_PRSTATUS 

Contains copy of prstatus struct.

NT_FPREGSET 

Contains copy of fpregset struct.

NT_PRPSINFO 

Contains copy of prpsinfo struct.

NT_PRXREG 

Contains copy of prxregset struct.

NT_TASKSTRUCT 

Contains copy of task structure.

NT_PLATFORM 

String from sysinfo(SI_PLATFORM)

NT_AUXV 

Contains copy of auxv array.

NT_GWINDOWS 

Contains copy of gwindows struct.

NT_ASRS 

Contains copy of asrset struct.

NT_PSTATUS 

Contains copy of pstatus struct.

NT_PSINFO 

Contains copy of psinfo struct.

NT_PRCRED 

Contains copy of prcred struct.

NT_UTSNAME 

Contains copy of utsname struct.

NT_LWPSTATUS 

Contains copy of lwpstatus struct.

NT_LWPSINFO 

Contains copy of lwpinfo struct.

NT_PRFPXREG 

Contains copy of fprxregset struct.

Definition at line 487 of file elf.h.

◆ Elf_NTs_obj

Legal values for the note segment descriptor types for object files.


Enumerator
NT_VERSION 

Contains a version string.

Definition at line 508 of file elf.h.

◆ Elf_OSABIs

enum Elf_OSABIs

Identify operating system and ABI to which the object is targeted.

Enumerator
ELFOSABI_NONE 

UNIX System V ABI.

ELFOSABI_SYSV 

Alias.


ELFOSABI_HPUX 

HP-UX.

ELFOSABI_NETBSD 

NetBSD.


ELFOSABI_LINUX 

Linux.


ELFOSABI_SOLARIS 

Sun Solaris.


ELFOSABI_AIX 

IBM AIX.


ELFOSABI_IRIX 

SGI Irix.


ELFOSABI_FREEBSD 

FreeBSD.


ELFOSABI_TRU64 

Compaq TRU64 UNIX.


ELFOSABI_MODESTO 

Novell Modesto.


ELFOSABI_OPENBSD 

OpenBSD.


ELFOSABI_ARM 

ARM.

ELFOSABI_STANDALONE 

Standalone (embedded) application.

Definition at line 316 of file elf.h.

◆ ELF_PFs

enum ELF_PFs

Segment permissions.

Enumerator
PF_X 

Executable.

PF_W 

Write.

PF_R 

Read.

PF_MASKOS 

OS-specific.

PF_MASKPROC 

Processor-specific.

Definition at line 477 of file elf.h.

◆ Elf_PTs

enum Elf_PTs

Segment types.

Enumerator
PT_NULL 

array is unused

PT_LOAD 

loadable

PT_DYNAMIC 

dynamic linking information

PT_INTERP 

path to interpreter

PT_NOTE 

auxiliary information

PT_SHLIB 

reserved

PT_PHDR 

location of the pht itself

PT_TLS 

Thread-local storage segment.

PT_NUM 

Number of defined types.

PT_LOOS 

OS-specific.

PT_HIOS 

OS-specific.

PT_LOPROC 

processor-specific

PT_HIPROC 

processor-specific

PT_GNU_EH_FRAME 

EH frame information.

PT_GNU_STACK 

Flags for stack.

PT_GNU_RELRO 

Read only after reloc.

PT_L4_STACK 

Address of the stack.

PT_L4_KIP 

Address of the KIP.

PT_L4_AUX 

Address of the AUX structures.

Definition at line 451 of file elf.h.

◆ Elf_R_386_s

Relocation types (processor specific).

Enumerator
R_386_NONE 

none

R_386_32 

S + A.

R_386_PC32 

S + A - P.

R_386_GOT32 

G + A - P.

R_386_PLT32 

L + A - P.

R_386_COPY 

none

R_386_GLOB_DAT 

S.

R_386_JMP_SLOT 

S.

R_386_RELATIVE 

B + A.

R_386_GOTOFF 

S + A - GOT.

R_386_GOTPC 

GOT + A - P.

R_386_TLS_TPOFF 

Offset in static TLS block.

R_386_TLS_IE 

Address of GOT entry for static TLS block offset.

R_386_TLS_GOTIE 

GOT entry for static TLS block offset.

R_386_TLS_LE 

Offset relative to static TLS block.

R_386_TLS_GD 

Direct 32 bit for GNU version of general dynamic thread local data.

R_386_TLS_LDM 

Direct 32 bit for GNU version of local dynamic thread local data in LE code.

R_386_TLS_GD_32 

Direct 32 bit for general dynamic thread local data.

R_386_TLS_GD_PUSH 

Tag for pushl in GD TLS code.

R_386_TLS_GD_CALL 

Relocation for call to __tls_get_addr()

R_386_TLS_GD_POP 

Tag for popl in GD TLS code.

R_386_TLS_LDM_32 

Direct 32 bit for local dynamic thread local data in LE code.

R_386_TLS_LDM_PUSH 

Tag for pushl in LDM TLS code.

R_386_TLS_LDM_CALL 

Relocation for call to __tls_get_addr() in LDM code.

R_386_TLS_LDM_POP 

Tag for popl in LDM TLS code.

R_386_TLS_LDO_32 

Offset relative to TLS block.

R_386_TLS_IE_32 

GOT entry for negated static TLS block offset.

R_386_TLS_LE_32 

Negated offset relative to static TLS block.

R_386_TLS_DTPMOD32 

ID of module containing symbol.

R_386_TLS_DTPOFF32 

Offset in TLS block.

R_386_TLS_TPOFF32 

Negated offset in static TLS block.

R_386_NUM 

Keep this the last entry.

Definition at line 678 of file elf.h.

◆ Elf_R_AARCH64_s

AARCH64 relocations.

Enumerator
R_AARCH64_NONE 

No reloc.

Definition at line 826 of file elf.h.

◆ Elf_R_ARM_s

ARM relocations.

Enumerator
R_ARM_NONE 

No reloc.

R_ARM_PC24 

PC relative 26 bit branch.

R_ARM_ABS32 

Direct 32 bit

R_ARM_REL32 

PC relative 32 bit.

R_ARM_ABS16 

Direct 16 bit.

R_ARM_ABS12 

Direct 12 bit.

R_ARM_ABS8 

Direct 8 bit.

R_ARM_COPY 

Copy symbol at runtime.

R_ARM_GLOB_DAT 

Create GOT entry.

R_ARM_JUMP_SLOT 

Create PLT entry.

R_ARM_RELATIVE 

Adjust by program base.

R_ARM_GOTOFF 

32 bit offset to GOT

R_ARM_GOTPC 

32 bit PC relative offset to GOT

R_ARM_GOT32 

32 bit GOT entry

R_ARM_PLT32 

32 bit PLT address

R_ARM_THM_PC11 

thumb unconditional branch

R_ARM_THM_PC9 

thumb conditional branch

R_ARM_NUM 

Keep this the last entry.

Definition at line 778 of file elf.h.

◆ Elf_R_X86_64_s

AMD x86-64 relocations.

Enumerator
R_X86_64_NONE 

No reloc.

R_X86_64_64 

Direct 64 bit

R_X86_64_PC32 

PC relative 32 bit signed.

R_X86_64_GOT32 

32 bit GOT entry

R_X86_64_PLT32 

32 bit PLT address

R_X86_64_COPY 

Copy symbol at runtime.

R_X86_64_GLOB_DAT 

Create GOT entry.

R_X86_64_JUMP_SLOT 

Create PLT entry.

R_X86_64_RELATIVE 

Adjust by program base.

R_X86_64_GOTPCREL 

32 bit signed PC relative offset to GOT

R_X86_64_32 

Direct 32 bit zero extended.

R_X86_64_32S 

Direct 32 bit sign extended.

R_X86_64_16 

Direct 16 bit zero extended.

R_X86_64_PC16 

16 bit sign extended pc relative

R_X86_64_8 

Direct 8 bit sign extended

R_X86_64_PC8 

8 bit sign extended pc relative

R_X86_64_DTPMOD64 

ID of module containing symbol.

R_X86_64_DTPOFF64 

Offset in module's TLS block.

R_X86_64_TPOFF64 

Offset in initial TLS block.

R_X86_64_TLSGD 

32 bit signed PC relative offset to two GOT entries for GD symbol

R_X86_64_TLSLD 

32 bit signed PC relative offset to two GOT entries for LD symbol

R_X86_64_DTPOFF32 

Offset in TLS block.

R_X86_64_GOTTPOFF 

32 bit signed PC relative offset to GOT entry for IE symbol

R_X86_64_TPOFF32 

Offset in initial TLS block.

Definition at line 833 of file elf.h.

◆ Elf_SHF_s_ARM

ARM-specific values for Elf32_Shdr.sh_flags / Elf64_Shdr.sh_flags.

Enumerator
SHF_ARM_ENTRYSECT 

Section contains an entry point.

SHF_ARM_COMDEF 

Section may be multiply defined in the input to a link step.

Definition at line 763 of file elf.h.

◆ Elf_SHFs

enum Elf_SHFs

Section attribute flags.

Enumerator
SHF_WRITE 

writeable during execution

SHF_ALLOC 

section occupies virt memory

SHF_EXECINSTR 

code section

SHF_MERGE 

Might be merged.

SHF_STRINGS 

Contains nul-terminated strings.

SHF_INFO_LINK 

‘sh_info’ contains SHT index

SHF_LINK_ORDER 

Preserve order after combining.

SHF_OS_NONCONFORMING 

Non-standard OS-specific handling required.

SHF_GROUP 

Section is member of a group.


SHF_TLS 

Section hold thread-local data.


SHF_MASKOS 

OS-specific.


SHF_MASKPROC 

processor-specific mask

Definition at line 406 of file elf.h.

◆ Elf_SHNs

enum Elf_SHNs

Special section indexes.

Enumerator
SHN_UNDEF 

undefined section header entry

SHN_LORESERVE 

lower bound of reserved indexes

SHN_LOPROC 

lower bound of proc spec entr

SHN_HIPROC 

upper bound of proc spec entr

SHN_ABS 

absolute values for ref

SHN_COMMON 

common symbols

SHN_HIRESERVE 

upper bound of reserved indexes

Definition at line 335 of file elf.h.

◆ Elf_SHTs

enum Elf_SHTs

Section type.

Enumerator
SHT_NULL 

inactive section header

SHT_PROGBITS 

information defined by program

SHT_SYMTAB 

symbol table

SHT_STRTAB 

string table

SHT_RELA 

reloc entries w/ explicit addens

SHT_HASH 

symbol hash table

SHT_DYNAMIC 

information for dynamic linking

SHT_NOTE 

information that marks the file

SHT_NOBITS 

occupies no space in the file

SHT_REL 

reloc entries w/o explicit addens

SHT_SHLIB 

reserved + unspecified semantics

SHT_DYNSYM 

symbol table (dynamic

SHT_INIT_ARRAY 

Array of constructors.

SHT_FINI_ARRAY 

Array of destructors.

SHT_PREINIT_ARRAY 

Array of pre-constructors.

SHT_GROUP 

Section group.

SHT_SYMTAB_SHNDX 

Extended section indices.

SHT_NUM 

Number of defined types.


SHT_LOOS 

Start OS-specific.

SHT_HIOS 

End OS-specific.

SHT_LOPROC 

Start processor-specific.

SHT_HIPROC 

End processor-specific.

SHT_LOUSER 

Start application-specific.

SHT_HIUSER 

End application-specific.

Definition at line 377 of file elf.h.

◆ Elf_STBs

enum Elf_STBs

Symbol Binding.

See also
ELF32_ST_BIND, ELF64_ST_BIND
Enumerator
STB_LOCAL 

not visible outside object file

STB_GLOBAL 

visible to all objects being combined

STB_WEAK 

resemble global symbols

STB_LOOS 

OS-specific.

STB_HIOS 

OS-specific.

STB_LOPROC 

Processor-specific.

STB_HIPROC 

Processor-specific.

Definition at line 913 of file elf.h.

◆ Elf_STTs

enum Elf_STTs

Symbol Types.

See also
ELF32_ST_TYPE, ELF64_ST_TYPE
Enumerator
STT_NOTYPE 

symbol's type not specified

STT_OBJECT 

associated with a data object

STT_FUNC 

associated with a function or other code

STT_SECTION 

associated with a section

STT_FILE 

source file name associated with object

STT_LOOS 

OS-specific.

STT_HIOS 

OS-specific.

STT_LOPROC 

processor-specific

STT_HIPROC 

processor-specific

Definition at line 926 of file elf.h.