1 #-------------------------------------------------------------------------------
2 # elftools: elf/enums.py
4 # Mappings of enum names to values
6 # Eli Bendersky (eliben@gmail.com)
7 # This code is in the public domain
8 #-------------------------------------------------------------------------------
9 from ..construct
import Pass
12 # e_ident[EI_CLASS] in the ELF header
19 # e_ident[EI_DATA] in the ELF header
26 # e_version in the ELF header
27 ENUM_E_VERSION
= dict(
32 # e_ident[EI_OSABI] in the ELF header
50 ELFOSABI_STANDALONE
=255,
53 # e_type in the ELF header
62 _default_
='PROC_SPECIFIC',
65 # e_machine in the ELF header
66 # (this list is currently somewhat partial...)
67 ENUM_E_MACHINE
= dict(
84 # sh_type in the section header
100 SHT_PREINIT_ARRAY
=16,
105 SHT_GNU_HASH
=0x6ffffff6,
106 SHT_GNU_verdef
=0x6ffffffd,
107 SHT_GNU_verneed
=0x6ffffffe,
108 SHT_GNU_versym
=0x6fffffff,
109 SHT_LOPROC
=0x70000000,
110 SHT_HIPROC
=0x7fffffff,
111 SHT_LOUSER
=0x80000000,
112 SHT_HIUSER
=0xffffffff,
113 SHT_AMD64_UNWIND
=0x70000001,
114 _default_
='RESERVED',
117 # p_type in the program header
118 # some values scavenged from the ELF headers in binutils-2.21
128 PT_LOPROC
=0x70000000,
129 PT_HIPROC
=0x7fffffff,
130 PT_GNU_EH_FRAME
=0x6474e550,
131 PT_GNU_STACK
=0x6474e551,
132 PT_GNU_RELRO
=0x6474e552,
135 # st_info bindings in the symbol header
136 ENUM_ST_INFO_BIND
= dict(
147 # st_info type in the symbol header
148 ENUM_ST_INFO_TYPE
= dict(
165 # visibility from st_other
166 ENUM_ST_VISIBILITY
= dict(
174 ENUM_ST_SHNDX
= dict(