00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030 #ifndef _ELF_REPL_H
00031 #define _ELF_REPL_H
00032
00033 #ifdef __cplusplus
00034 extern "C" {
00035 #endif
00036
00037
00038
00039
00040 typedef __libelf_u32_t Elf32_Addr;
00041 typedef __libelf_u16_t Elf32_Half;
00042 typedef __libelf_u32_t Elf32_Off;
00043 typedef __libelf_i32_t Elf32_Sword;
00044 typedef __libelf_u32_t Elf32_Word;
00045
00046 #define ELF32_FSZ_ADDR 4
00047 #define ELF32_FSZ_HALF 2
00048 #define ELF32_FSZ_OFF 4
00049 #define ELF32_FSZ_SWORD 4
00050 #define ELF32_FSZ_WORD 4
00051
00052 #if __LIBELF64
00053
00054 typedef __libelf_u64_t Elf64_Addr;
00055 typedef __libelf_u16_t Elf64_Half;
00056 typedef __libelf_u64_t Elf64_Off;
00057 typedef __libelf_i32_t Elf64_Sword;
00058 typedef __libelf_u32_t Elf64_Word;
00059 typedef __libelf_i64_t Elf64_Sxword;
00060 typedef __libelf_u64_t Elf64_Xword;
00061
00062 #define ELF64_FSZ_ADDR 8
00063 #define ELF64_FSZ_HALF 2
00064 #define ELF64_FSZ_OFF 8
00065 #define ELF64_FSZ_SWORD 4
00066 #define ELF64_FSZ_WORD 4
00067 #define ELF64_FSZ_SXWORD 8
00068 #define ELF64_FSZ_XWORD 8
00069
00070
00071
00072
00073 typedef __libelf_u64_t Elf64_Lword;
00074 typedef __libelf_u64_t Elf32_Lword;
00075
00076 #endif
00077
00078
00079
00080
00081 #define EI_NIDENT 16
00082
00083 typedef struct {
00084 unsigned char e_ident[EI_NIDENT];
00085 Elf32_Half e_type;
00086 Elf32_Half e_machine;
00087 Elf32_Word e_version;
00088 Elf32_Addr e_entry;
00089 Elf32_Off e_phoff;
00090 Elf32_Off e_shoff;
00091 Elf32_Word e_flags;
00092 Elf32_Half e_ehsize;
00093 Elf32_Half e_phentsize;
00094 Elf32_Half e_phnum;
00095 Elf32_Half e_shentsize;
00096 Elf32_Half e_shnum;
00097 Elf32_Half e_shstrndx;
00098 } Elf32_Ehdr;
00099
00100 #if __LIBELF64
00101 typedef struct {
00102 unsigned char e_ident[EI_NIDENT];
00103 Elf64_Half e_type;
00104 Elf64_Half e_machine;
00105 Elf64_Word e_version;
00106 Elf64_Addr e_entry;
00107 Elf64_Off e_phoff;
00108 Elf64_Off e_shoff;
00109 Elf64_Word e_flags;
00110 Elf64_Half e_ehsize;
00111 Elf64_Half e_phentsize;
00112 Elf64_Half e_phnum;
00113 Elf64_Half e_shentsize;
00114 Elf64_Half e_shnum;
00115 Elf64_Half e_shstrndx;
00116 } Elf64_Ehdr;
00117 #endif
00118
00119
00120
00121
00122 #define EI_MAG0 0
00123 #define EI_MAG1 1
00124 #define EI_MAG2 2
00125 #define EI_MAG3 3
00126 #define EI_CLASS 4
00127 #define EI_DATA 5
00128 #define EI_VERSION 6
00129 #define EI_OSABI 7
00130 #define EI_ABIVERSION 8
00131 #define EI_PAD 9
00132
00133 #define ELFMAG0 0x7f
00134 #define ELFMAG1 'E'
00135 #define ELFMAG2 'L'
00136 #define ELFMAG3 'F'
00137 #define ELFMAG "\177ELF"
00138 #define SELFMAG 4
00139
00140
00141
00142
00143 #define ELFCLASSNONE 0
00144 #define ELFCLASS32 1
00145 #define ELFCLASS64 2
00146 #define ELFCLASSNUM 3
00147
00148
00149
00150
00151 #define ELFDATANONE 0
00152 #define ELFDATA2LSB 1
00153 #define ELFDATA2MSB 2
00154 #define ELFDATANUM 3
00155
00156
00157
00158
00159 #define ELFOSABI_NONE 0
00160 #define ELFOSABI_SYSV ELFOSABI_NONE
00161 #define ELFOSABI_HPUX 1
00162 #define ELFOSABI_NETBSD 2
00163 #define ELFOSABI_LINUX 3
00164 #define ELFOSABI_SOLARIS 6
00165 #define ELFOSABI_AIX 7
00166 #define ELFOSABI_IRIX 8
00167 #define ELFOSABI_FREEBSD 9
00168 #define ELFOSABI_TRU64 10
00169 #define ELFOSABI_MODESTO 11
00170 #define ELFOSABI_OPENBSD 12
00171 #define ELFOSABI_OPENVMS 13
00172 #define ELFOSABI_NSK 14
00173
00174 #define ELFOSABI_ARM 97
00175 #define ELFOSABI_STANDALONE 255
00176
00177
00178
00179
00180
00181 #define ET_NONE 0
00182 #define ET_REL 1
00183 #define ET_EXEC 2
00184 #define ET_DYN 3
00185 #define ET_CORE 4
00186 #define ET_NUM 5
00187 #define ET_LOOS 0xfe00
00188 #define ET_HIOS 0xfeff
00189 #define ET_LOPROC 0xff00
00190 #define ET_HIPROC 0xffff
00191
00192
00193
00194
00195 #define EM_NONE 0
00196 #define EM_M32 1
00197 #define EM_SPARC 2
00198 #define EM_386 3
00199 #define EM_68K 4
00200 #define EM_88K 5
00201 #define EM_486 6
00202 #define EM_860 7
00203 #define EM_MIPS 8
00204 #define EM_S370 9
00205 #define EM_MIPS_RS3_LE 10
00206 #define EM_SPARC64 11
00207 #define EM_PARISC 15
00208 #define EM_VPP500 17
00209 #define EM_SPARC32PLUS 18
00210 #define EM_960 19
00211 #define EM_PPC 20
00212 #define EM_PPC64 21
00213 #define EM_S390 22
00214 #define EM_V800 36
00215 #define EM_FR20 37
00216 #define EM_RH32 38
00217 #define EM_RCE 39
00218 #define EM_ARM 40
00219 #define EM_ALPHA 41
00220 #define EM_SH 42
00221 #define EM_SPARCV9 43
00222 #define EM_TRICORE 44
00223 #define EM_ARC 45
00224 #define EM_H8_300 46
00225 #define EM_H8_300H 47
00226 #define EM_H8S 48
00227 #define EM_H8_500 49
00228 #define EM_IA_64 50
00229 #define EM_MIPS_X 51
00230 #define EM_COLDFIRE 52
00231 #define EM_68HC12 53
00232 #define EM_MMA 54
00233 #define EM_PCP 55
00234 #define EM_NCPU 56
00235 #define EM_NDR1 57
00236 #define EM_STARCORE 58
00237 #define EM_ME16 59
00238 #define EM_ST100 60
00239 #define EM_TINYJ 61
00240 #define EM_X86_64 62
00241 #define EM_PDSP 63
00242 #define EM_FX66 66
00243 #define EM_ST9PLUS 67
00244 #define EM_ST7 68
00245 #define EM_68HC16 69
00246 #define EM_68HC11 70
00247 #define EM_68HC08 71
00248 #define EM_68HC05 72
00249 #define EM_SVX 73
00250 #define EM_ST19 74
00251 #define EM_VAX 75
00252 #define EM_CRIS 76
00253 #define EM_JAVELIN 77
00254 #define EM_FIREPATH 78
00255 #define EM_ZSP 79
00256 #define EM_MMIX 80
00257 #define EM_HUANY 81
00258 #define EM_PRISM 82
00259 #define EM_AVR 83
00260 #define EM_FR30 84
00261 #define EM_D10V 85
00262 #define EM_D30V 86
00263 #define EM_V850 87
00264 #define EM_M32R 88
00265 #define EM_MN10300 89
00266 #define EM_MN10200 90
00267 #define EM_PJ 91
00268 #define EM_OPENRISC 92
00269 #define EM_ARC_A5 93
00270 #define EM_XTENSA 94
00271 #define EM_VIDEOCORE 95
00272 #define EM_TMM_GPP 96
00273 #define EM_NS32K 97
00274 #define EM_TPC 98
00275 #define EM_SNP1K 99
00276 #define EM_ST200 100
00277 #define EM_NUM 101
00278
00279
00280
00281
00282 #define EV_NONE 0
00283 #define EV_CURRENT 1
00284 #define EV_NUM 2
00285
00286
00287
00288
00289 typedef struct {
00290 Elf32_Word sh_name;
00291 Elf32_Word sh_type;
00292 Elf32_Word sh_flags;
00293 Elf32_Addr sh_addr;
00294 Elf32_Off sh_offset;
00295 Elf32_Word sh_size;
00296 Elf32_Word sh_link;
00297 Elf32_Word sh_info;
00298 Elf32_Word sh_addralign;
00299 Elf32_Word sh_entsize;
00300 } Elf32_Shdr;
00301
00302 #if __LIBELF64
00303 typedef struct {
00304 Elf64_Word sh_name;
00305 Elf64_Word sh_type;
00306 Elf64_Xword sh_flags;
00307 Elf64_Addr sh_addr;
00308 Elf64_Off sh_offset;
00309 Elf64_Xword sh_size;
00310 Elf64_Word sh_link;
00311 Elf64_Word sh_info;
00312 Elf64_Xword sh_addralign;
00313 Elf64_Xword sh_entsize;
00314 } Elf64_Shdr;
00315 #endif
00316
00317
00318
00319
00320 #define SHN_UNDEF 0
00321 #define SHN_LORESERVE 0xff00
00322 #define SHN_LOPROC 0xff00
00323 #define SHN_HIPROC 0xff1f
00324 #define SHN_LOOS 0xff20
00325 #define SHN_HIOS 0xff3f
00326 #define SHN_ABS 0xfff1
00327 #define SHN_COMMON 0xfff2
00328 #define SHN_XINDEX 0xffff
00329 #define SHN_HIRESERVE 0xffff
00330
00331
00332
00333
00334 #define SHT_NULL 0
00335 #define SHT_PROGBITS 1
00336 #define SHT_SYMTAB 2
00337 #define SHT_STRTAB 3
00338 #define SHT_RELA 4
00339 #define SHT_HASH 5
00340 #define SHT_DYNAMIC 6
00341 #define SHT_NOTE 7
00342 #define SHT_NOBITS 8
00343 #define SHT_REL 9
00344 #define SHT_SHLIB 10
00345 #define SHT_DYNSYM 11
00346 #define SHT_INIT_ARRAY 14
00347 #define SHT_FINI_ARRAY 15
00348 #define SHT_PREINIT_ARRAY 16
00349 #define SHT_GROUP 17
00350 #define SHT_SYMTAB_SHNDX 18
00351 #define SHT_NUM 19
00352 #define SHT_LOOS 0x60000000
00353 #define SHT_HIOS 0x6fffffff
00354 #define SHT_LOPROC 0x70000000
00355 #define SHT_HIPROC 0x7fffffff
00356 #define SHT_LOUSER 0x80000000
00357 #define SHT_HIUSER 0xffffffff
00358
00359
00360
00361
00362 #define SHT_SUNW_move 0x6ffffffa
00363 #define SHT_SUNW_COMDAT 0x6ffffffb
00364 #define SHT_SUNW_syminfo 0x6ffffffc
00365 #define SHT_SUNW_verdef 0x6ffffffd
00366 #define SHT_SUNW_verneed 0x6ffffffe
00367 #define SHT_SUNW_versym 0x6fffffff
00368
00369
00370
00371
00372 #define SHT_GNU_verdef 0x6ffffffd
00373 #define SHT_GNU_verneed 0x6ffffffe
00374 #define SHT_GNU_versym 0x6fffffff
00375
00376
00377
00378
00379 #define SHF_WRITE 0x1
00380 #define SHF_ALLOC 0x2
00381 #define SHF_EXECINSTR 0x4
00382 #define SHF_MERGE 0x10
00383 #define SHF_STRINGS 0x20
00384 #define SHF_INFO_LINK 0x40
00385 #define SHF_LINK_ORDER 0x80
00386 #define SHF_OS_NONCONFORMING 0x100
00387 #define SHF_GROUP 0x200
00388 #define SHF_TLS 0x400
00389 #define SHF_MASKOS 0x0ff00000
00390 #define SHF_MASKPROC 0xf0000000
00391
00392
00393
00394
00395 #define GRP_COMDAT 0x1
00396 #define GRP_MASKOS 0x0ff00000
00397 #define GRP_MASKPROC 0xf0000000
00398
00399
00400
00401
00402 typedef struct {
00403 Elf32_Word st_name;
00404 Elf32_Addr st_value;
00405 Elf32_Word st_size;
00406 unsigned char st_info;
00407 unsigned char st_other;
00408 Elf32_Half st_shndx;
00409 } Elf32_Sym;
00410
00411 #if __LIBELF64
00412 typedef struct {
00413 Elf64_Word st_name;
00414 unsigned char st_info;
00415 unsigned char st_other;
00416 Elf64_Half st_shndx;
00417 Elf64_Addr st_value;
00418 Elf64_Xword st_size;
00419 } Elf64_Sym;
00420 #endif
00421
00422
00423
00424
00425 #define STN_UNDEF 0
00426
00427
00428
00429
00430 #define ELF32_ST_BIND(i) ((i)>>4)
00431 #define ELF32_ST_TYPE(i) ((i)&0xf)
00432 #define ELF32_ST_INFO(b,t) (((b)<<4)+((t)&0xf))
00433
00434 #if __LIBELF64
00435 #define ELF64_ST_BIND(i) ((i)>>4)
00436 #define ELF64_ST_TYPE(i) ((i)&0xf)
00437 #define ELF64_ST_INFO(b,t) (((b)<<4)+((t)&0xf))
00438 #endif
00439
00440
00441
00442
00443 #define STB_LOCAL 0
00444 #define STB_GLOBAL 1
00445 #define STB_WEAK 2
00446 #define STB_NUM 3
00447 #define STB_LOOS 10
00448 #define STB_HIOS 12
00449 #define STB_LOPROC 13
00450 #define STB_HIPROC 15
00451
00452
00453
00454
00455 #define STT_NOTYPE 0
00456 #define STT_OBJECT 1
00457 #define STT_FUNC 2
00458 #define STT_SECTION 3
00459 #define STT_FILE 4
00460 #define STT_COMMON 5
00461 #define STT_TLS 6
00462 #define STT_NUM 7
00463 #define STT_LOOS 10
00464 #define STT_HIOS 12
00465 #define STT_LOPROC 13
00466 #define STT_HIPROC 15
00467
00468
00469
00470
00471 #define ELF32_ST_VISIBILITY(o) ((o)&0x3)
00472 #if __LIBELF64
00473 #define ELF64_ST_VISIBILITY(o) ((o)&0x3)
00474 #endif
00475
00476
00477
00478
00479 #define STV_DEFAULT 0
00480 #define STV_INTERNAL 1
00481 #define STV_HIDDEN 2
00482 #define STV_PROTECTED 3
00483
00484
00485
00486
00487 typedef struct {
00488 Elf32_Addr r_offset;
00489 Elf32_Word r_info;
00490 } Elf32_Rel;
00491
00492 typedef struct {
00493 Elf32_Addr r_offset;
00494 Elf32_Word r_info;
00495 Elf32_Sword r_addend;
00496 } Elf32_Rela;
00497
00498 #if __LIBELF64
00499 typedef struct {
00500 Elf64_Addr r_offset;
00501 Elf64_Xword r_info;
00502 } Elf64_Rel;
00503
00504 typedef struct {
00505 Elf64_Addr r_offset;
00506 Elf64_Xword r_info;
00507 Elf64_Sxword r_addend;
00508 } Elf64_Rela;
00509 #endif
00510
00511
00512
00513
00514 #define ELF32_R_SYM(i) ((i)>>8)
00515 #define ELF32_R_TYPE(i) ((unsigned char)(i))
00516 #define ELF32_R_INFO(s,t) (((s)<<8)+(unsigned char)(t))
00517
00518 #if __LIBELF64
00519 #define ELF64_R_SYM(i) ((Elf64_Xword)(i)>>32)
00520 #define ELF64_R_TYPE(i) ((i)&0xffffffffL)
00521 #define ELF64_R_INFO(s,t) (((Elf64_Xword)(s)<<32)+((t)&0xffffffffL))
00522 #endif
00523
00524
00525
00526
00527 typedef struct {
00528 Elf32_Word n_namesz;
00529 Elf32_Word n_descsz;
00530 Elf32_Word n_type;
00531 } Elf32_Nhdr;
00532
00533 #if __LIBELF64
00534
00535
00536 typedef struct {
00537 Elf64_Word n_namesz;
00538 Elf64_Word n_descsz;
00539 Elf64_Word n_type;
00540 } Elf64_Nhdr;
00541 #endif
00542
00543
00544
00545
00546 #define NT_PRSTATUS 1
00547 #define NT_PRFPREG 2
00548 #define NT_PRPSINFO 3
00549
00550
00551
00552
00553 typedef struct {
00554 Elf32_Word p_type;
00555 Elf32_Off p_offset;
00556 Elf32_Addr p_vaddr;
00557 Elf32_Addr p_paddr;
00558 Elf32_Word p_filesz;
00559 Elf32_Word p_memsz;
00560 Elf32_Word p_flags;
00561 Elf32_Word p_align;
00562 } Elf32_Phdr;
00563
00564 #if __LIBELF64
00565 typedef struct {
00566 Elf64_Word p_type;
00567 Elf64_Word p_flags;
00568 Elf64_Off p_offset;
00569 Elf64_Addr p_vaddr;
00570 Elf64_Addr p_paddr;
00571 Elf64_Xword p_filesz;
00572 Elf64_Xword p_memsz;
00573 Elf64_Xword p_align;
00574 } Elf64_Phdr;
00575 #endif
00576
00577
00578
00579
00580 #define PT_NULL 0
00581 #define PT_LOAD 1
00582 #define PT_DYNAMIC 2
00583 #define PT_INTERP 3
00584 #define PT_NOTE 4
00585 #define PT_SHLIB 5
00586 #define PT_PHDR 6
00587 #define PT_TLS 7
00588 #define PT_NUM 8
00589 #define PT_LOOS 0x60000000
00590 #define PT_HIOS 0x6fffffff
00591 #define PT_LOPROC 0x70000000
00592 #define PT_HIPROC 0x7fffffff
00593
00594
00595
00596
00597 #define PF_X 0x1
00598 #define PF_W 0x2
00599 #define PF_R 0x4
00600 #define PF_MASKOS 0x0ff00000
00601 #define PF_MASKPROC 0xf0000000
00602
00603
00604
00605
00606 typedef struct {
00607 Elf32_Sword d_tag;
00608 union {
00609 Elf32_Word d_val;
00610 Elf32_Addr d_ptr;
00611 } d_un;
00612 } Elf32_Dyn;
00613
00614 #if __LIBELF64
00615 typedef struct {
00616 Elf64_Sxword d_tag;
00617 union {
00618 Elf64_Xword d_val;
00619 Elf64_Addr d_ptr;
00620 } d_un;
00621 } Elf64_Dyn;
00622 #endif
00623
00624
00625
00626
00627
00628 #define DT_NULL 0
00629 #define DT_NEEDED 1
00630 #define DT_PLTRELSZ 2
00631 #define DT_PLTGOT 3
00632 #define DT_HASH 4
00633 #define DT_STRTAB 5
00634 #define DT_SYMTAB 6
00635 #define DT_RELA 7
00636 #define DT_RELASZ 8
00637 #define DT_RELAENT 9
00638 #define DT_STRSZ 10
00639 #define DT_SYMENT 11
00640 #define DT_INIT 12
00641 #define DT_FINI 13
00642 #define DT_SONAME 14
00643 #define DT_RPATH 15
00644 #define DT_SYMBOLIC 16
00645 #define DT_REL 17
00646 #define DT_RELSZ 18
00647 #define DT_RELENT 19
00648 #define DT_PLTREL 20
00649 #define DT_DEBUG 21
00650 #define DT_TEXTREL 22
00651 #define DT_JMPREL 23
00652 #define DT_BIND_NOW 24
00653 #define DT_INIT_ARRAY 25
00654 #define DT_FINI_ARRAY 26
00655 #define DT_INIT_ARRAYSZ 27
00656 #define DT_FINI_ARRAYSZ 28
00657 #define DT_RUNPATH 29
00658 #define DT_FLAGS 30
00659 #define DT_ENCODING 32
00660 #define DT_PREINIT_ARRAY 32
00661 #define DT_PREINIT_ARRAYSZ 33
00662 #define DT_NUM 34
00663 #define DT_LOOS 0x6000000D
00664 #define DT_HIOS 0x6ffff000
00665 #define DT_LOPROC 0x70000000
00666 #define DT_HIPROC 0x7fffffff
00667
00668
00669
00670
00671 #define DF_ORIGIN 0x1
00672 #define DF_SYMBOLIC 0x2
00673 #define DF_TEXTREL 0x4
00674 #define DF_BIND_NOW 0x8
00675 #define DF_STATIC_TLS 0x10
00676
00677
00678
00679
00680 #define DT_VALRNGLO 0x6ffffd00
00681 #define DT_CHECKSUM 0x6ffffdf8
00682 #define DT_PLTPADSZ 0x6ffffdf9
00683 #define DT_MOVEENT 0x6ffffdfa
00684 #define DT_MOVESZ 0x6ffffdfb
00685 #define DT_FEATURE_1 0x6ffffdfc
00686 #define DT_POSFLAG_1 0x6ffffdfd
00687 #define DT_SYMINSZ 0x6ffffdfe
00688 #define DT_SYMINENT 0x6ffffdff
00689 #define DT_VALRNGHI 0x6ffffdff
00690
00691 #define DT_ADDRRNGLO 0x6ffffe00
00692 #define DT_CONFIG 0x6ffffefa
00693 #define DT_DEPAUDIT 0x6ffffefb
00694 #define DT_AUDIT 0x6ffffefc
00695 #define DT_PLTPAD 0x6ffffefd
00696 #define DT_MOVETAB 0x6ffffefe
00697 #define DT_SYMINFO 0x6ffffeff
00698 #define DT_ADDRRNGHI 0x6ffffeff
00699
00700 #define DT_RELACOUNT 0x6ffffff9
00701 #define DT_RELCOUNT 0x6ffffffa
00702 #define DT_FLAGS_1 0x6ffffffb
00703 #define DT_VERDEF 0x6ffffffc
00704 #define DT_VERDEFNUM 0x6ffffffd
00705 #define DT_VERNEED 0x6ffffffe
00706 #define DT_VERNEEDNUM 0x6fffffff
00707
00708 #define DT_AUXILIARY 0x7ffffffd
00709 #define DT_USED 0x7ffffffe
00710 #define DT_FILTER 0x7fffffff
00711
00712
00713
00714
00715 #define DT_VERSYM 0x6ffffff0
00716
00717
00718
00719
00720 #define DTF_1_PARINIT 0x1
00721 #define DTF_1_CONFEXP 0x2
00722
00723
00724
00725
00726 #define DF_P1_LAZYLOAD 0x1
00727 #define DF_P1_GROUPPERM 0x2
00728
00729
00730
00731
00732 #define DF_1_NOW 0x00000001
00733 #define DF_1_GLOBAL 0x00000002
00734 #define DF_1_GROUP 0x00000004
00735 #define DF_1_NODELETE 0x00000008
00736 #define DF_1_LOADFLTR 0x00000010
00737 #define DF_1_INITFIRST 0x00000020
00738 #define DF_1_NOOPEN 0x00000040
00739 #define DF_1_ORIGIN 0x00000080
00740 #define DF_1_DIRECT 0x00000100
00741 #define DF_1_TRANS 0x00000200
00742 #define DF_1_INTERPOSE 0x00000400
00743 #define DF_1_NODEFLIB 0x00000800
00744 #define DF_1_NODUMP 0x00001000
00745 #define DF_1_CONFALT 0x00002000
00746 #define DF_1_ENDFILTEE 0x00004000
00747 #define DF_1_DISPRELDNE 0x00008000
00748 #define DF_1_DISPRELPND 0x00010000
00749
00750
00751
00752
00753 typedef struct {
00754 Elf32_Half si_boundto;
00755 Elf32_Half si_flags;
00756 } Elf32_Syminfo;
00757
00758 #if __LIBELF64
00759 typedef struct {
00760 Elf64_Half si_boundto;
00761 Elf64_Half si_flags;
00762 } Elf64_Syminfo;
00763 #endif
00764
00765
00766
00767
00768 #define SYMINFO_NONE 0
00769 #define SYMINFO_CURRENT 1
00770 #define SYMINFO_NUM 2
00771
00772
00773
00774
00775 #define SYMINFO_BT_LOWRESERVE 0xff00
00776 #define SYMINFO_BT_PARENT 0xfffe
00777 #define SYMINFO_BT_SELF 0xffff
00778
00779
00780
00781
00782 #define SYMINFO_FLG_DIRECT 0x01
00783 #define SYMINFO_FLG_PASSTHRU 0x02
00784 #define SYMINFO_FLG_COPY 0x04
00785 #define SYMINFO_FLG_LAZYLOAD 0x08
00786
00787
00788
00789
00790 typedef struct {
00791 Elf32_Half vd_version;
00792 Elf32_Half vd_flags;
00793 Elf32_Half vd_ndx;
00794 Elf32_Half vd_cnt;
00795 Elf32_Word vd_hash;
00796 Elf32_Word vd_aux;
00797 Elf32_Word vd_next;
00798 } Elf32_Verdef;
00799
00800 typedef struct {
00801 Elf32_Word vda_name;
00802 Elf32_Word vda_next;
00803 } Elf32_Verdaux;
00804
00805 typedef struct {
00806 Elf32_Half vn_version;
00807 Elf32_Half vn_cnt;
00808 Elf32_Word vn_file;
00809 Elf32_Word vn_aux;
00810 Elf32_Word vn_next;
00811 } Elf32_Verneed;
00812
00813 typedef struct {
00814 Elf32_Word vna_hash;
00815 Elf32_Half vna_flags;
00816 Elf32_Half vna_other;
00817 Elf32_Word vna_name;
00818 Elf32_Word vna_next;
00819 } Elf32_Vernaux;
00820
00821 typedef Elf32_Half Elf32_Versym;
00822
00823 #if __LIBELF64
00824
00825 typedef struct {
00826 Elf64_Half vd_version;
00827 Elf64_Half vd_flags;
00828 Elf64_Half vd_ndx;
00829 Elf64_Half vd_cnt;
00830 Elf64_Word vd_hash;
00831 Elf64_Word vd_aux;
00832 Elf64_Word vd_next;
00833 } Elf64_Verdef;
00834
00835 typedef struct {
00836 Elf64_Word vda_name;
00837 Elf64_Word vda_next;
00838 } Elf64_Verdaux;
00839
00840 typedef struct {
00841 Elf64_Half vn_version;
00842 Elf64_Half vn_cnt;
00843 Elf64_Word vn_file;
00844 Elf64_Word vn_aux;
00845 Elf64_Word vn_next;
00846 } Elf64_Verneed;
00847
00848 typedef struct {
00849 Elf64_Word vna_hash;
00850 Elf64_Half vna_flags;
00851 Elf64_Half vna_other;
00852 Elf64_Word vna_name;
00853 Elf64_Word vna_next;
00854 } Elf64_Vernaux;
00855
00856 typedef Elf64_Half Elf64_Versym;
00857
00858 #endif
00859
00860
00861
00862
00863 #define VER_DEF_NONE 0
00864 #define VER_DEF_CURRENT 1
00865 #define VER_DEF_NUM 2
00866
00867
00868
00869
00870 #define VER_NEED_NONE 0
00871 #define VER_NEED_CURRENT 1
00872 #define VER_NEED_NUM 2
00873
00874
00875
00876
00877 #define VER_FLG_BASE 0x1
00878 #define VER_FLG_WEAK 0x2
00879
00880
00881
00882
00883 #define VER_NDX_LOCAL 0
00884 #define VER_NDX_GLOBAL 1
00885
00886
00887
00888
00889 #if __LIBELF64
00890
00891 typedef struct {
00892 Elf32_Lword m_value;
00893 Elf32_Word m_info;
00894 Elf32_Word m_poffset;
00895 Elf32_Half m_repeat;
00896 Elf32_Half m_stride;
00897 } Elf32_Move;
00898
00899 typedef struct {
00900 Elf64_Lword m_value;
00901 Elf64_Xword m_info;
00902 Elf64_Xword m_poffset;
00903 Elf64_Half m_repeat;
00904 Elf64_Half m_stride;
00905 } Elf64_Move;
00906
00907 #define ELF32_M_SYM(info) ((info)>>8)
00908 #define ELF32_M_SIZE(info) ((unsigned char)(info))
00909 #define ELF32_M_INFO(sym, sz) (((sym)<<8)+(unsigned char)(sz))
00910
00911 #define ELF64_M_SYM(info) ((Elf64_Xword)(info)>>8)
00912 #define ELF64_M_SIZE(info) ((unsigned char)(info))
00913 #define ELF64_M_INFO(sym, sz) (((Elf64_Xword)(sym)<<8)+(unsigned char)(sz))
00914
00915 #endif
00916
00917 #ifdef __cplusplus
00918 }
00919 #endif
00920
00921 #endif