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
34 EF_MIPS_64BIT_WHIRL
=16
37 EF_MIPS_32BITMODE
= 256
39 EF_MIPS_ARCH
=0xf0000000
40 EF_MIPS_ARCH_1
=0x00000000
41 EF_MIPS_ARCH_2
=0x10000000
42 EF_MIPS_ARCH_3
=0x20000000
43 EF_MIPS_ARCH_4
=0x30000000
44 EF_MIPS_ARCH_5
=0x40000000
45 EF_MIPS_ARCH_32
=0x50000000
46 EF_MIPS_ARCH_64
=0x60000000
47 EF_MIPS_ARCH_32R2
=0x70000000
48 EF_MIPS_ARCH_64R2
=0x80000000
51 class E_FLAGS_MASKS(object):
52 """Masks to be used for convenience when working with E_FLAGS
54 This is a simplified approach that is also used by GNU binutils
57 EFM_MIPS_ABI
= 0x0000F000
58 EFM_MIPS_ABI_O32
= 0x00001000
59 EFM_MIPS_ABI_O64
= 0x00002000
60 EFM_MIPS_ABI_EABI32
= 0x00003000
61 EFM_MIPS_ABI_EABI64
= 0x00004000
64 class SHN_INDICES(object):
65 """ Special section indices
77 class SH_FLAGS(object):
78 """ Flag values for the sh_flags field of section headers
87 SHF_OS_NONCONFORMING
=0x100
92 SHF_EXCLUDE
=0x80000000
93 SHF_MASKPROC
=0xf0000000
96 class RH_FLAGS(object):
97 """ Flag values for the DT_MIPS_FLAGS dynamic table entries
100 RHF_QUICKSTART
=0x00000001
101 RHF_NOTPOT
=0x00000002
102 RHF_NO_LIBRARY_REPLACEMENT
=0x00000004
103 RHF_NO_MOVE
=0x00000008
104 RHF_SGI_ONLY
=0x00000010
105 RHF_GUARANTEE_INIT
=0x00000020
106 RHF_DELTA_C_PLUS_PLUS
=0x00000040
107 RHF_GUARANTEE_START_INIT
=0x00000080
109 RHF_DEFAULT_DELAY_LOAD
=0x00000200
110 RHF_REQUICKSTART
=0x00000400
111 RHF_REQUICKSTARTED
=0x00000800
113 RHF_NO_UNRES_UNDEF
=0x00002000
114 RHF_RLD_ORDER_SAFE
=0x00004000
117 class P_FLAGS(object):
118 """ Flag values for the p_flags field of program headers
124 PF_MASKPROC
=0xFF000000
127 # symbol info flags for entries
128 # in the .SUNW_syminfo section
129 class SUNW_SYMINFO_FLAGS(object):
130 """ Flags for the si_flags field of entries
131 in the .SUNW_syminfo section
133 SYMINFO_FLG_DIRECT
=0x1
134 SYMINFO_FLG_FILTER
=0x2
136 SYMINFO_FLG_LAZYLOAD
=0x8
137 SYMINFO_FLG_DIRECTBIND
=0x10
138 SYMINFO_FLG_NOEXTDIRECT
=0x20
139 SYMINFO_FLG_AUXILIARY
=0x40
140 SYMINFO_FLG_INTERPOSE
=0x80
141 SYMINFO_FLG_CAP
=0x100
142 SYMINFO_FLG_DEFERRED
=0x200
144 class VER_FLAGS(object):