6 typedef uint16_t Elf32_Half
;
8 typedef uint32_t Elf32_Word
;
9 typedef int32_t Elf32_Sword
;
11 typedef uint32_t Elf32_Addr
;
12 typedef uint32_t Elf32_Off
;
13 typedef uint16_t Elf32_Section
;
15 #define EI_NIDENT (16)
18 unsigned char e_ident
[EI_NIDENT
];
27 Elf32_Half e_phentsize
;
29 Elf32_Half e_shentsize
;
31 Elf32_Half e_shstrndx
;
34 #define ELFMAG "\177ELF"
38 #define ELFCLASSNONE 0
52 #define ELFOSABI_NONE 0
53 #define ELFOSABI_SYSV 0
54 #define ELFOSABI_HPUX 1
55 #define ELFOSABI_NETBSD 2
56 #define ELFOSABI_LINUX 3
57 #define ELFOSABI_SOLARIS 6
58 #define ELFOSABI_AIX 7
59 #define ELFOSABI_IRIX 8
60 #define ELFOSABI_FREEBSD 9
61 #define ELFOSABI_TRU64 10
62 #define ELFOSABI_MODESTO 11
63 #define ELFOSABI_OPENBSD 12
64 #define ELFOSABI_ARM 97
65 #define ELFOSABI_STANDALONE 255
67 #define EI_ABIVERSION 8
77 #define ET_LOOS 0xfe00
78 #define ET_HIOS 0xfeff
79 #define ET_LOPROC 0xff00
80 #define ET_HIPROC 0xffff
91 #define EM_MIPS_RS3_LE 10
95 #define EM_SPARC32PLUS 18
106 #define EM_FAKE_ALPHA 41
108 #define EM_SPARCV9 43
109 #define EM_TRICORE 44
112 #define EM_H8_300H 47
117 #define EM_COLDFIRE 52
123 #define EM_STARCORE 58
131 #define EM_ST9PLUS 67
141 #define EM_JAVELIN 77
142 #define EM_FIREPATH 78
153 #define EM_MN10300 89
154 #define EM_MN10200 90
156 #define EM_OPENRISC 92
160 #define EM_ALPHA 0x9026
175 Elf32_Word sh_addralign
;
176 Elf32_Word sh_entsize
;
180 #define SHN_LORESERVE 0xff00
181 #define SHN_LOPROC 0xff00
182 #define SHN_BEFORE 0xff00
184 #define SHN_AFTER 0xff01
186 #define SHN_HIPROC 0xff1f
187 #define SHN_LOOS 0xff20
188 #define SHN_HIOS 0xff3f
189 #define SHN_ABS 0xfff1
190 #define SHN_COMMON 0xfff2
191 #define SHN_XINDEX 0xffff
192 #define SHN_HIRESERVE 0xffff
195 #define SHT_PROGBITS 1
200 #define SHT_DYNAMIC 6
205 #define SHT_DYNSYM 11
206 #define SHT_INIT_ARRAY 14
207 #define SHT_FINI_ARRAY 15
208 #define SHT_PREINIT_ARRAY 16
210 #define SHT_SYMTAB_SHNDX 18
212 #define SHT_LOPROC 0x70000000
213 #define SHT_HIPROC 0x7fffffff
214 #define SHT_LOUSER 0x80000000
215 #define SHT_HIUSER 0x8fffffff
217 #define SHF_WRITE (1 << 0)
218 #define SHF_ALLOC (1 << 1)
219 #define SHF_EXECINSTR (1 << 2)
220 #define SHF_MERGE (1 << 4)
221 #define SHF_STRINGS (1 << 5)
222 #define SHF_INFO_LINK (1 << 6)
223 #define SHF_LINK_ORDER (1 << 7)
224 #define SHF_OS_NONCONFORMING (1 << 8)
226 #define SHF_GROUP (1 << 9)
227 #define SHF_TLS (1 << 10)
228 #define SHF_MASKOS 0x0ff00000
229 #define SHF_MASKPROC 0xf0000000
230 #define SHF_ORDERED (1 << 30)
231 #define SHF_EXCLUDE (1 << 31)
233 #define GRP_COMDAT 0x1
239 unsigned char st_info
;
240 unsigned char st_other
;
241 Elf32_Section st_shndx
;
244 #define ELF32_ST_BIND(val) (((unsigned char) (val)) >> 4)
245 #define ELF32_ST_TYPE(val) ((val) & 0xf)
246 #define ELF32_ST_INFO(bind, type) (((bind) << 4) + ((type) & 0xf))
248 #define ELF64_ST_BIND(val) ELF32_ST_BIND (val)
249 #define ELF64_ST_TYPE(val) ELF32_ST_TYPE (val)
250 #define ELF64_ST_INFO(bind, type) ELF32_ST_INFO ((bind), (type))
257 #define STB_GNU_UNIQUE 10
259 #define STB_LOPROC 13
260 #define STB_HIPROC 15
265 #define STT_SECTION 3
271 #define STT_GNU_IFUNC 10
273 #define STT_LOPROC 13
274 #define STT_HIPROC 15
278 #define ELF32_ST_VISIBILITY(o) ((o) & 0x03)
279 #define ELF64_ST_VISIBILITY(o) ELF32_ST_VISIBILITY (o)
281 #define STV_DEFAULT 0
282 #define STV_INTERNAL 1
284 #define STV_PROTECTED 3
296 Elf32_Sword r_addend
;
299 #define ELF32_R_SYM(val) ((val) >> 8)
300 #define ELF32_R_TYPE(val) ((val) & 0xff)
301 #define ELF32_R_INFO(sym, type) (((sym) << 8) + ((type) & 0xff))
323 #define PT_LOPROC 0x70000000
324 #define PT_HIPROC 0x7fffffff
326 #define PF_X (1 << 0)
327 #define PF_W (1 << 1)
328 #define PF_R (1 << 2)
329 #define PF_MASKOS 0x0ff00000
330 #define PF_MASKPROC 0xf0000000
332 #define NT_PRSTATUS 1
333 #define NT_FPREGSET 2
334 #define NT_PRPSINFO 3
336 #define NT_TASKSTRUCT 4
337 #define NT_PLATFORM 5
339 #define NT_GWINDOWS 7
341 #define NT_PSTATUS 10
344 #define NT_UTSNAME 15
345 #define NT_LWPSTATUS 16
346 #define NT_LWPSINFO 17
347 #define NT_PRFPXREG 20
348 #define NT_PRXFPREG 0x46e62b7f
349 #define NT_PPC_VMX 0x100
350 #define NT_PPC_SPE 0x101
351 #define NT_PPC_VSX 0x102
352 #define NT_386_TLS 0x200
353 #define NT_386_IOPERM 0x201
359 #define R_386_GOT32 3
360 #define R_386_PLT32 4
362 #define R_386_GLOB_DAT 6
363 #define R_386_JMP_SLOT 7
364 #define R_386_RELATIVE 8
365 #define R_386_GOTOFF 9
366 #define R_386_GOTPC 10
367 #define R_386_32PLT 11
368 #define R_386_TLS_TPOFF 14
369 #define R_386_TLS_IE 15
370 #define R_386_TLS_GOTIE 16
371 #define R_386_TLS_LE 17
372 #define R_386_TLS_GD 18
373 #define R_386_TLS_LDM 19
375 #define R_386_PC16 21
378 #define R_386_TLS_GD_32 24
379 #define R_386_TLS_GD_PUSH 25
380 #define R_386_TLS_GD_CALL 26
381 #define R_386_TLS_GD_POP 27
382 #define R_386_TLS_LDM_32 28
383 #define R_386_TLS_LDM_PUSH 29
384 #define R_386_TLS_LDM_CALL 30
385 #define R_386_TLS_LDM_POP 31
386 #define R_386_TLS_LDO_32 32
387 #define R_386_TLS_IE_32 33
388 #define R_386_TLS_LE_32 34
389 #define R_386_TLS_DTPMOD32 35
390 #define R_386_TLS_DTPOFF32 36
391 #define R_386_TLS_TPOFF32 37
392 #define R_386_TLS_GOTDESC 39
393 #define R_386_TLS_DESC_CALL 40
394 #define R_386_TLS_DESC 41
395 #define R_386_IRELATIVE 42
398 #define EF_ARM_RELEXEC 0x01
399 #define EF_ARM_HASENTRY 0x02
400 #define EF_ARM_INTERWORK 0x04
401 #define EF_ARM_APCS_26 0x08
402 #define EF_ARM_APCS_FLOAT 0x10
403 #define EF_ARM_PIC 0x20
404 #define EF_ARM_ALIGN8 0x40
405 #define EF_ARM_NEW_ABI 0x80
406 #define EF_ARM_OLD_ABI 0x100
407 #define EF_ARM_SOFT_FLOAT 0x200
408 #define EF_ARM_VFP_FLOAT 0x400
409 #define EF_ARM_MAVERICK_FLOAT 0x800
411 #define EF_ARM_SYMSARESORTED 0x04
412 #define EF_ARM_DYNSYMSUSESEGIDX 0x08
413 #define EF_ARM_MAPSYMSFIRST 0x10
414 #define EF_ARM_EABIMASK 0XFF000000
416 #define EF_ARM_BE8 0x00800000
417 #define EF_ARM_LE8 0x00400000
419 #define EF_ARM_EABI_VERSION(flags) ((flags) & EF_ARM_EABIMASK)
420 #define EF_ARM_EABI_UNKNOWN 0x00000000
421 #define EF_ARM_EABI_VER1 0x01000000
422 #define EF_ARM_EABI_VER2 0x02000000
423 #define EF_ARM_EABI_VER3 0x03000000
424 #define EF_ARM_EABI_VER4 0x04000000
425 #define EF_ARM_EABI_VER5 0x05000000
427 #define STT_ARM_TFUNC STT_LOPROC
428 #define STT_ARM_16BIT STT_HIPROC
430 #define SHF_ARM_ENTRYSECT 0x10000000
431 #define SHF_ARM_COMDEF 0x80000000
433 #define PF_ARM_SB 0x10000000
435 #define PF_ARM_PI 0x20000000
436 #define PF_ARM_ABS 0x40000000
438 #define PT_ARM_EXIDX (PT_LOPROC + 1)
440 #define SHT_ARM_EXIDX (SHT_LOPROC + 1)
441 #define SHT_ARM_PREEMPTMAP (SHT_LOPROC + 2)
442 #define SHT_ARM_ATTRIBUTES (SHT_LOPROC + 3)
446 #define R_ARM_ABS32 2
447 #define R_ARM_REL32 3
449 #define R_ARM_ABS16 5
450 #define R_ARM_ABS12 6
451 #define R_ARM_THM_ABS5 7
453 #define R_ARM_SBREL32 9
454 #define R_ARM_THM_PC22 10
455 #define R_ARM_THM_PC8 11
456 #define R_ARM_AMP_VCALL9 12
457 #define R_ARM_SWI24 13
458 #define R_ARM_THM_SWI8 14
459 #define R_ARM_XPC25 15
460 #define R_ARM_THM_XPC22 16
461 #define R_ARM_TLS_DTPMOD32 17
462 #define R_ARM_TLS_DTPOFF32 18
463 #define R_ARM_TLS_TPOFF32 19
464 #define R_ARM_COPY 20
465 #define R_ARM_GLOB_DAT 21
466 #define R_ARM_JUMP_SLOT 22
467 #define R_ARM_RELATIVE 23
468 #define R_ARM_GOTOFF 24
469 #define R_ARM_GOTPC 25
470 #define R_ARM_GOT32 26
471 #define R_ARM_PLT32 27
472 #define R_ARM_ALU_PCREL_7_0 32
473 #define R_ARM_ALU_PCREL_15_8 33
474 #define R_ARM_ALU_PCREL_23_15 34
475 #define R_ARM_LDR_SBREL_11_0 35
476 #define R_ARM_ALU_SBREL_19_12 36
477 #define R_ARM_ALU_SBREL_27_20 37
478 #define R_ARM_GNU_VTENTRY 100
479 #define R_ARM_GNU_VTINHERIT 101
480 #define R_ARM_THM_PC11 102
481 #define R_ARM_THM_PC9 103
482 #define R_ARM_TLS_GD32 104
484 #define R_ARM_TLS_LDM32 105
486 #define R_ARM_TLS_LDO32 106
488 #define R_ARM_TLS_IE32 107
490 #define R_ARM_TLS_LE32 108
492 #define R_ARM_RXPC25 249
493 #define R_ARM_RSBREL32 250
494 #define R_ARM_THM_RPC22 251
495 #define R_ARM_RREL32 252
496 #define R_ARM_RABS22 253
497 #define R_ARM_RPC24 254
498 #define R_ARM_RBASE 255
500 #define R_ARM_NUM 256