/[gentoo-projects]/pax-utils/elf.h
Gentoo

Diff of /pax-utils/elf.h

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

Revision 1.6 Revision 1.7
51typedef uint16_t Elf64_Section; 51typedef uint16_t Elf64_Section;
52 52
53/* Type for version symbol information. */ 53/* Type for version symbol information. */
54typedef Elf32_Half Elf32_Versym; 54typedef Elf32_Half Elf32_Versym;
55typedef Elf64_Half Elf64_Versym; 55typedef Elf64_Half Elf64_Versym;
56
57 56
58/* The ELF file header. This appears at the start of every ELF file. */ 57/* The ELF file header. This appears at the start of every ELF file. */
59 58
60#define EI_NIDENT (16) 59#define EI_NIDENT (16)
61 60
431/* Syminfo version values. */ 430/* Syminfo version values. */
432#define SYMINFO_NONE 0 431#define SYMINFO_NONE 0
433#define SYMINFO_CURRENT 1 432#define SYMINFO_CURRENT 1
434#define SYMINFO_NUM 2 433#define SYMINFO_NUM 2
435 434
436
437/* How to extract and insert information held in the st_info field. */ 435/* How to extract and insert information held in the st_info field. */
438 436
439#define ELF32_ST_BIND(val) (((unsigned char) (val)) >> 4) 437#define ELF32_ST_BIND(val) (((unsigned char) (val)) >> 4)
440#define ELF32_ST_TYPE(val) ((val) & 0xf) 438#define ELF32_ST_TYPE(val) ((val) & 0xf)
441#define ELF32_ST_INFO(bind, type) (((bind) << 4) + ((type) & 0xf)) 439#define ELF32_ST_INFO(bind, type) (((bind) << 4) + ((type) & 0xf))
469#define STT_LOOS 10 /* Start of OS-specific */ 467#define STT_LOOS 10 /* Start of OS-specific */
470#define STT_HIOS 12 /* End of OS-specific */ 468#define STT_HIOS 12 /* End of OS-specific */
471#define STT_LOPROC 13 /* Start of processor-specific */ 469#define STT_LOPROC 13 /* Start of processor-specific */
472#define STT_HIPROC 15 /* End of processor-specific */ 470#define STT_HIPROC 15 /* End of processor-specific */
473 471
474
475/* Symbol table indices are found in the hash buckets and chain table 472/* Symbol table indices are found in the hash buckets and chain table
476 of a symbol hash table section. This special index value indicates 473 of a symbol hash table section. This special index value indicates
477 the end of a chain, meaning no further symbols are found in that bucket. */ 474 the end of a chain, meaning no further symbols are found in that bucket. */
478 475
479#define STN_UNDEF 0 /* End of a chain. */ 476#define STN_UNDEF 0 /* End of a chain. */
480
481 477
482/* How to extract and insert information held in the st_other field. */ 478/* How to extract and insert information held in the st_other field. */
483 479
484#define ELF32_ST_VISIBILITY(o) ((o) & 0x03) 480#define ELF32_ST_VISIBILITY(o) ((o) & 0x03)
485 481
489/* Symbol visibility specification encoded in the st_other field. */ 485/* Symbol visibility specification encoded in the st_other field. */
490#define STV_DEFAULT 0 /* Default symbol visibility rules */ 486#define STV_DEFAULT 0 /* Default symbol visibility rules */
491#define STV_INTERNAL 1 /* Processor specific hidden class */ 487#define STV_INTERNAL 1 /* Processor specific hidden class */
492#define STV_HIDDEN 2 /* Sym unavailable in other modules */ 488#define STV_HIDDEN 2 /* Sym unavailable in other modules */
493#define STV_PROTECTED 3 /* Not preemptible, not exported */ 489#define STV_PROTECTED 3 /* Not preemptible, not exported */
494
495 490
496/* Relocation table entry without addend (in section of type SHT_REL). */ 491/* Relocation table entry without addend (in section of type SHT_REL). */
497 492
498typedef struct 493typedef struct
499{ 494{
615#define NT_PRFPXREG 20 /* Contains copy of fprxregset struct*/ 610#define NT_PRFPXREG 20 /* Contains copy of fprxregset struct*/
616 611
617/* Legal values for the note segment descriptor types for object files. */ 612/* Legal values for the note segment descriptor types for object files. */
618 613
619#define NT_VERSION 1 /* Contains a version string. */ 614#define NT_VERSION 1 /* Contains a version string. */
620
621 615
622/* Dynamic section entry. */ 616/* Dynamic section entry. */
623 617
624typedef struct 618typedef struct
625{ 619{
807 Elf64_Word vd_aux; /* Offset in bytes to verdaux array */ 801 Elf64_Word vd_aux; /* Offset in bytes to verdaux array */
808 Elf64_Word vd_next; /* Offset in bytes to next verdef 802 Elf64_Word vd_next; /* Offset in bytes to next verdef
809 entry */ 803 entry */
810} Elf64_Verdef; 804} Elf64_Verdef;
811 805
812
813/* Legal values for vd_version (version revision). */ 806/* Legal values for vd_version (version revision). */
814#define VER_DEF_NONE 0 /* No version */ 807#define VER_DEF_NONE 0 /* No version */
815#define VER_DEF_CURRENT 1 /* Current version */ 808#define VER_DEF_CURRENT 1 /* Current version */
816#define VER_DEF_NUM 2 /* Given version number */ 809#define VER_DEF_NUM 2 /* Given version number */
817 810
838{ 831{
839 Elf64_Word vda_name; /* Version or dependency names */ 832 Elf64_Word vda_name; /* Version or dependency names */
840 Elf64_Word vda_next; /* Offset in bytes to next verdaux 833 Elf64_Word vda_next; /* Offset in bytes to next verdaux
841 entry */ 834 entry */
842} Elf64_Verdaux; 835} Elf64_Verdaux;
843
844 836
845/* Version dependency section. */ 837/* Version dependency section. */
846 838
847typedef struct 839typedef struct
848{ 840{
864 Elf64_Word vn_aux; /* Offset in bytes to vernaux array */ 856 Elf64_Word vn_aux; /* Offset in bytes to vernaux array */
865 Elf64_Word vn_next; /* Offset in bytes to next verneed 857 Elf64_Word vn_next; /* Offset in bytes to next verneed
866 entry */ 858 entry */
867} Elf64_Verneed; 859} Elf64_Verneed;
868 860
869
870/* Legal values for vn_version (version revision). */ 861/* Legal values for vn_version (version revision). */
871#define VER_NEED_NONE 0 /* No version */ 862#define VER_NEED_NONE 0 /* No version */
872#define VER_NEED_CURRENT 1 /* Current version */ 863#define VER_NEED_CURRENT 1 /* Current version */
873#define VER_NEED_NUM 2 /* Given version number */ 864#define VER_NEED_NUM 2 /* Given version number */
874 865
892 Elf64_Word vna_name; /* Dependency name string offset */ 883 Elf64_Word vna_name; /* Dependency name string offset */
893 Elf64_Word vna_next; /* Offset in bytes to next vernaux 884 Elf64_Word vna_next; /* Offset in bytes to next vernaux
894 entry */ 885 entry */
895} Elf64_Vernaux; 886} Elf64_Vernaux;
896 887
897
898/* Legal values for vna_flags. */ 888/* Legal values for vna_flags. */
899#define VER_FLG_WEAK 0x2 /* Weak version identifier */ 889#define VER_FLG_WEAK 0x2 /* Weak version identifier */
900
901 890
902/* Auxiliary vector. */ 891/* Auxiliary vector. */
903 892
904/* This vector is normally only used by the program interpreter. The 893/* This vector is normally only used by the program interpreter. The
905 usual definition in an ABI supplement uses the name auxv_t. The 894 usual definition in an ABI supplement uses the name auxv_t. The
1006#define ELF_NOTE_SOLARIS "SUNW Solaris" 995#define ELF_NOTE_SOLARIS "SUNW Solaris"
1007 996
1008/* Note entries for GNU systems have this name. */ 997/* Note entries for GNU systems have this name. */
1009#define ELF_NOTE_GNU "GNU" 998#define ELF_NOTE_GNU "GNU"
1010 999
1011
1012/* Defined types of notes for Solaris. */ 1000/* Defined types of notes for Solaris. */
1013 1001
1014/* Value of descriptor (one word) is desired pagesize for the binary. */ 1002/* Value of descriptor (one word) is desired pagesize for the binary. */
1015#define ELF_NOTE_PAGESIZE_HINT 1 1003#define ELF_NOTE_PAGESIZE_HINT 1
1016
1017 1004
1018/* Defined note types for GNU systems. */ 1005/* Defined note types for GNU systems. */
1019 1006
1020/* ABI information. The descriptor consists of words: 1007/* ABI information. The descriptor consists of words:
1021 word 0: OS descriptor 1008 word 0: OS descriptor
1030#define ELF_NOTE_OS_LINUX 0 1017#define ELF_NOTE_OS_LINUX 0
1031#define ELF_NOTE_OS_GNU 1 1018#define ELF_NOTE_OS_GNU 1
1032#define ELF_NOTE_OS_SOLARIS2 2 1019#define ELF_NOTE_OS_SOLARIS2 2
1033#define ELF_NOTE_OS_FREEBSD 3 1020#define ELF_NOTE_OS_FREEBSD 3
1034 1021
1035
1036/* Move records. */ 1022/* Move records. */
1037typedef struct 1023typedef struct
1038{ 1024{
1039 Elf32_Xword m_value; /* Symbol value. */ 1025 Elf32_Xword m_value; /* Symbol value. */
1040 Elf32_Word m_info; /* Size and index. */ 1026 Elf32_Word m_info; /* Size and index. */
1058#define ELF32_M_INFO(sym, size) (((sym) << 8) + (unsigned char) (size)) 1044#define ELF32_M_INFO(sym, size) (((sym) << 8) + (unsigned char) (size))
1059 1045
1060#define ELF64_M_SYM(info) ELF32_M_SYM (info) 1046#define ELF64_M_SYM(info) ELF32_M_SYM (info)
1061#define ELF64_M_SIZE(info) ELF32_M_SIZE (info) 1047#define ELF64_M_SIZE(info) ELF32_M_SIZE (info)
1062#define ELF64_M_INFO(sym, size) ELF32_M_INFO (sym, size) 1048#define ELF64_M_INFO(sym, size) ELF32_M_INFO (sym, size)
1063
1064 1049
1065/* Motorola 68k specific definitions. */ 1050/* Motorola 68k specific definitions. */
1066 1051
1067/* Values for Elf32_Ehdr.e_flags. */ 1052/* Values for Elf32_Ehdr.e_flags. */
1068#define EF_CPU32 0x00810000 1053#define EF_CPU32 0x00810000
1362#define SHF_MIPS_NOSTRIP 0x08000000 1347#define SHF_MIPS_NOSTRIP 0x08000000
1363#define SHF_MIPS_LOCAL 0x04000000 1348#define SHF_MIPS_LOCAL 0x04000000
1364#define SHF_MIPS_NAMES 0x02000000 1349#define SHF_MIPS_NAMES 0x02000000
1365#define SHF_MIPS_NODUPE 0x01000000 1350#define SHF_MIPS_NODUPE 0x01000000
1366 1351
1367
1368/* Symbol tables. */ 1352/* Symbol tables. */
1369 1353
1370/* MIPS specific values for `st_other'. */ 1354/* MIPS specific values for `st_other'. */
1371#define STO_MIPS_DEFAULT 0x0 1355#define STO_MIPS_DEFAULT 0x0
1372#define STO_MIPS_INTERNAL 0x1 1356#define STO_MIPS_INTERNAL 0x1
1623 Elf64_Word l_checksum; /* Checksum */ 1607 Elf64_Word l_checksum; /* Checksum */
1624 Elf64_Word l_version; /* Interface version */ 1608 Elf64_Word l_version; /* Interface version */
1625 Elf64_Word l_flags; /* Flags */ 1609 Elf64_Word l_flags; /* Flags */
1626} Elf64_Lib; 1610} Elf64_Lib;
1627 1611
1628
1629/* Legal values for l_flags. */ 1612/* Legal values for l_flags. */
1630 1613
1631#define LL_NONE 0 1614#define LL_NONE 0
1632#define LL_EXACT_MATCH (1 << 0) /* Require exact match */ 1615#define LL_EXACT_MATCH (1 << 0) /* Require exact match */
1633#define LL_IGNORE_INT_VER (1 << 1) /* Ignore interface version */ 1616#define LL_IGNORE_INT_VER (1 << 1) /* Ignore interface version */
1637#define LL_DELTA (1 << 5) 1620#define LL_DELTA (1 << 5)
1638 1621
1639/* Entries found in sections of type SHT_MIPS_CONFLICT. */ 1622/* Entries found in sections of type SHT_MIPS_CONFLICT. */
1640 1623
1641typedef Elf32_Addr Elf32_Conflict; 1624typedef Elf32_Addr Elf32_Conflict;
1642
1643 1625
1644/* HPPA specific definitions. */ 1626/* HPPA specific definitions. */
1645 1627
1646/* Legal values for e_flags field of Elf32_Ehdr. */ 1628/* Legal values for e_flags field of Elf32_Ehdr. */
1647 1629
1807#define PF_HP_CODE 0x01000000 1789#define PF_HP_CODE 0x01000000
1808#define PF_HP_MODIFY 0x02000000 1790#define PF_HP_MODIFY 0x02000000
1809#define PF_HP_LAZYSWAP 0x04000000 1791#define PF_HP_LAZYSWAP 0x04000000
1810#define PF_HP_SBP 0x08000000 1792#define PF_HP_SBP 0x08000000
1811 1793
1812
1813/* Alpha specific definitions. */ 1794/* Alpha specific definitions. */
1814 1795
1815/* Legal values for e_flags field of Elf64_Ehdr. */ 1796/* Legal values for e_flags field of Elf64_Ehdr. */
1816 1797
1817#define EF_ALPHA_32BIT 1 /* All addresses must be < 2GB. */ 1798#define EF_ALPHA_32BIT 1 /* All addresses must be < 2GB. */
2122/* PowerPC64 specific values for the Dyn d_tag field. */ 2103/* PowerPC64 specific values for the Dyn d_tag field. */
2123#define DT_PPC64_GLINK (DT_LOPROC + 0) 2104#define DT_PPC64_GLINK (DT_LOPROC + 0)
2124#define DT_PPC64_OPD (DT_LOPROC + 1) 2105#define DT_PPC64_OPD (DT_LOPROC + 1)
2125#define DT_PPC64_OPDSZ (DT_LOPROC + 2) 2106#define DT_PPC64_OPDSZ (DT_LOPROC + 2)
2126#define DT_PPC64_NUM 3 2107#define DT_PPC64_NUM 3
2127
2128 2108
2129/* ARM specific declarations */ 2109/* ARM specific declarations */
2130 2110
2131/* Processor specific flags for the ELF header e_flags field. */ 2111/* Processor specific flags for the ELF header e_flags field. */
2132#define EF_ARM_RELEXEC 0x01 2112#define EF_ARM_RELEXEC 0x01
2463#define R_390_TLS_GOTIE20 60 /* 20 bit GOT offset for static TLS 2443#define R_390_TLS_GOTIE20 60 /* 20 bit GOT offset for static TLS
2464 block offset. */ 2444 block offset. */
2465/* Keep this the last entry. */ 2445/* Keep this the last entry. */
2466#define R_390_NUM 61 2446#define R_390_NUM 61
2467 2447
2468
2469/* CRIS relocations. */ 2448/* CRIS relocations. */
2470#define R_CRIS_NONE 0 2449#define R_CRIS_NONE 0
2471#define R_CRIS_8 1 2450#define R_CRIS_8 1
2472#define R_CRIS_16 2 2451#define R_CRIS_16 2
2473#define R_CRIS_32 3 2452#define R_CRIS_32 3
2487#define R_CRIS_32_GOTREL 17 2466#define R_CRIS_32_GOTREL 17
2488#define R_CRIS_32_PLT_GOTREL 18 2467#define R_CRIS_32_PLT_GOTREL 18
2489#define R_CRIS_32_PLT_PCREL 19 2468#define R_CRIS_32_PLT_PCREL 19
2490 2469
2491#define R_CRIS_NUM 20 2470#define R_CRIS_NUM 20
2492
2493 2471
2494/* AMD x86-64 relocations. */ 2472/* AMD x86-64 relocations. */
2495#define R_X86_64_NONE 0 /* No reloc */ 2473#define R_X86_64_NONE 0 /* No reloc */
2496#define R_X86_64_64 1 /* Direct 64 bit */ 2474#define R_X86_64_64 1 /* Direct 64 bit */
2497#define R_X86_64_PC32 2 /* PC relative 32 bit signed */ 2475#define R_X86_64_PC32 2 /* PC relative 32 bit signed */
2521 to GOT entry for IE symbol */ 2499 to GOT entry for IE symbol */
2522#define R_X86_64_TPOFF32 23 /* Offset in initial TLS block */ 2500#define R_X86_64_TPOFF32 23 /* Offset in initial TLS block */
2523 2501
2524#define R_X86_64_NUM 24 2502#define R_X86_64_NUM 24
2525 2503
2526
2527/* AM33 relocations. */ 2504/* AM33 relocations. */
2528#define R_MN10300_NONE 0 /* No reloc. */ 2505#define R_MN10300_NONE 0 /* No reloc. */
2529#define R_MN10300_32 1 /* Direct 32 bit. */ 2506#define R_MN10300_32 1 /* Direct 32 bit. */
2530#define R_MN10300_16 2 /* Direct 16 bit. */ 2507#define R_MN10300_16 2 /* Direct 16 bit. */
2531#define R_MN10300_8 3 /* Direct 8 bit. */ 2508#define R_MN10300_8 3 /* Direct 8 bit. */
2549#define R_MN10300_GLOB_DAT 21 /* Create GOT entry. */ 2526#define R_MN10300_GLOB_DAT 21 /* Create GOT entry. */
2550#define R_MN10300_JMP_SLOT 22 /* Create PLT entry. */ 2527#define R_MN10300_JMP_SLOT 22 /* Create PLT entry. */
2551#define R_MN10300_RELATIVE 23 /* Adjust by program base. */ 2528#define R_MN10300_RELATIVE 23 /* Adjust by program base. */
2552 2529
2553#define R_MN10300_NUM 24 2530#define R_MN10300_NUM 24
2554
2555 2531
2556/* M32R relocs. */ 2532/* M32R relocs. */
2557#define R_M32R_NONE 0 /* No reloc. */ 2533#define R_M32R_NONE 0 /* No reloc. */
2558#define R_M32R_16 1 /* Direct 16 bit. */ 2534#define R_M32R_16 1 /* Direct 16 bit. */
2559#define R_M32R_32 2 /* Direct 32 bit. */ 2535#define R_M32R_32 2 /* Direct 32 bit. */

Legend:
Removed from v.1.6  
changed lines
  Added in v.1.7

  ViewVC Help
Powered by ViewVC 1.1.20