1 #-------------------------------------------------------------------------------
2 # elftools: elf/constants.py
4 # Constants and flags, placed into classes for namespacing
6 # Eli Bendersky (eliben@gmail.com)
7 # This code is in the public domain
8 #-------------------------------------------------------------------------------
10 class E_FLAGS(object):
11 """ Flag values for the e_flags field of the ELF header
13 EF_ARM_EABIMASK
=0xFF000000
14 EF_ARM_EABI_VER1
=0x01000000
15 EF_ARM_EABI_VER2
=0x02000000
16 EF_ARM_EABI_VER3
=0x03000000
17 EF_ARM_EABI_VER4
=0x04000000
18 EF_ARM_EABI_VER5
=0x05000000
19 EF_ARM_GCCMASK
=0x00400FFF
22 EF_ARM_SYMSARESORTED
=0x04
23 EF_ARM_DYNSYMSUSESEGIDX
=0x8
24 EF_ARM_MAPSYMSFIRST
=0x10
27 EF_ARM_ABI_FLOAT_SOFT
=0x00000200
28 EF_ARM_ABI_FLOAT_HARD
=0x00000400
38 EF_MIPS_64BIT_WHIRL
=16
41 EF_MIPS_32BITMODE
= 256
43 EF_MIPS_ARCH
=0xf0000000
44 EF_MIPS_ARCH_1
=0x00000000
45 EF_MIPS_ARCH_2
=0x10000000
46 EF_MIPS_ARCH_3
=0x20000000
47 EF_MIPS_ARCH_4
=0x30000000
48 EF_MIPS_ARCH_5
=0x40000000
49 EF_MIPS_ARCH_32
=0x50000000
50 EF_MIPS_ARCH_64
=0x60000000
51 EF_MIPS_ARCH_32R2
=0x70000000
52 EF_MIPS_ARCH_64R2
=0x80000000
55 class E_FLAGS_MASKS(object):
56 """Masks to be used for convenience when working with E_FLAGS
58 This is a simplified approach that is also used by GNU binutils
61 EFM_MIPS_ABI
= 0x0000F000
62 EFM_MIPS_ABI_O32
= 0x00001000
63 EFM_MIPS_ABI_O64
= 0x00002000
64 EFM_MIPS_ABI_EABI32
= 0x00003000
65 EFM_MIPS_ABI_EABI64
= 0x00004000
68 class SHN_INDICES(object):
69 """ Special section indices
81 class SH_FLAGS(object):
82 """ Flag values for the sh_flags field of section headers
91 SHF_OS_NONCONFORMING
=0x100
96 SHF_EXCLUDE
=0x80000000
97 SHF_MASKPROC
=0xf0000000
100 class RH_FLAGS(object):
101 """ Flag values for the DT_MIPS_FLAGS dynamic table entries
104 RHF_QUICKSTART
=0x00000001
105 RHF_NOTPOT
=0x00000002
106 RHF_NO_LIBRARY_REPLACEMENT
=0x00000004
107 RHF_NO_MOVE
=0x00000008
108 RHF_SGI_ONLY
=0x00000010
109 RHF_GUARANTEE_INIT
=0x00000020
110 RHF_DELTA_C_PLUS_PLUS
=0x00000040
111 RHF_GUARANTEE_START_INIT
=0x00000080
113 RHF_DEFAULT_DELAY_LOAD
=0x00000200
114 RHF_REQUICKSTART
=0x00000400
115 RHF_REQUICKSTARTED
=0x00000800
117 RHF_NO_UNRES_UNDEF
=0x00002000
118 RHF_RLD_ORDER_SAFE
=0x00004000
121 class P_FLAGS(object):
122 """ Flag values for the p_flags field of program headers
128 PF_MASKPROC
=0xFF000000
131 # symbol info flags for entries
132 # in the .SUNW_syminfo section
133 class SUNW_SYMINFO_FLAGS(object):
134 """ Flags for the si_flags field of entries
135 in the .SUNW_syminfo section
137 SYMINFO_FLG_DIRECT
=0x1
138 SYMINFO_FLG_FILTER
=0x2
140 SYMINFO_FLG_LAZYLOAD
=0x8
141 SYMINFO_FLG_DIRECTBIND
=0x10
142 SYMINFO_FLG_NOEXTDIRECT
=0x20
143 SYMINFO_FLG_AUXILIARY
=0x40
144 SYMINFO_FLG_INTERPOSE
=0x80
145 SYMINFO_FLG_CAP
=0x100
146 SYMINFO_FLG_DEFERRED
=0x200
148 class VER_FLAGS(object):