Annotation of Gnu-Mach/xen/public/elfstructs.h, revision 1.1.1.2

1.1       root        1: #ifndef __XEN_PUBLIC_ELFSTRUCTS_H__
                      2: #define __XEN_PUBLIC_ELFSTRUCTS_H__ 1
                      3: /*
                      4:  * Copyright (c) 1995, 1996 Erik Theisen.  All rights reserved.
                      5:  *
                      6:  * Redistribution and use in source and binary forms, with or without
                      7:  * modification, are permitted provided that the following conditions
                      8:  * are met:
                      9:  * 1. Redistributions of source code must retain the above copyright
                     10:  *    notice, this list of conditions and the following disclaimer.
                     11:  * 2. Redistributions in binary form must reproduce the above copyright
                     12:  *    notice, this list of conditions and the following disclaimer in the
                     13:  *    documentation and/or other materials provided with the distribution.
                     14:  * 3. The name of the author may not be used to endorse or promote products
                     15:  *    derived from this software without specific prior written permission
                     16:  *
                     17:  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
                     18:  * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
                     19:  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
                     20:  * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
                     21:  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
                     22:  * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
                     23:  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
                     24:  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
                     25:  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
                     26:  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
                     27:  */
                     28: 
                     29: typedef uint8_t                Elf_Byte;
                     30: 
                     31: typedef uint32_t       Elf32_Addr;     /* Unsigned program address */
                     32: typedef uint32_t       Elf32_Off;      /* Unsigned file offset */
                     33: typedef int32_t                Elf32_Sword;    /* Signed large integer */
                     34: typedef uint32_t       Elf32_Word;     /* Unsigned large integer */
                     35: typedef uint16_t       Elf32_Half;     /* Unsigned medium integer */
                     36: 
                     37: typedef uint64_t       Elf64_Addr;
                     38: typedef uint64_t       Elf64_Off;
                     39: typedef int32_t                Elf64_Shalf;
                     40: 
                     41: typedef int32_t                Elf64_Sword;
                     42: typedef uint32_t       Elf64_Word;
                     43: 
                     44: typedef int64_t                Elf64_Sxword;
                     45: typedef uint64_t       Elf64_Xword;
                     46: 
                     47: typedef uint32_t       Elf64_Half;
                     48: typedef uint16_t       Elf64_Quarter;
                     49: 
                     50: /*
                     51:  * e_ident[] identification indexes
                     52:  * See http://www.caldera.com/developers/gabi/2000-07-17/ch4.eheader.html
                     53:  */
                     54: #define EI_MAG0                0               /* file ID */
                     55: #define EI_MAG1                1               /* file ID */
                     56: #define EI_MAG2                2               /* file ID */
                     57: #define EI_MAG3                3               /* file ID */
                     58: #define EI_CLASS       4               /* file class */
                     59: #define EI_DATA                5               /* data encoding */
                     60: #define EI_VERSION     6               /* ELF header version */
                     61: #define EI_OSABI       7               /* OS/ABI ID */
                     62: #define EI_ABIVERSION  8               /* ABI version */
                     63: #define EI_PAD         9               /* start of pad bytes */
                     64: #define EI_NIDENT      16              /* Size of e_ident[] */
                     65: 
                     66: /* e_ident[] magic number */
                     67: #define        ELFMAG0         0x7f            /* e_ident[EI_MAG0] */
                     68: #define        ELFMAG1         'E'             /* e_ident[EI_MAG1] */
                     69: #define        ELFMAG2         'L'             /* e_ident[EI_MAG2] */
                     70: #define        ELFMAG3         'F'             /* e_ident[EI_MAG3] */
                     71: #define        ELFMAG          "\177ELF"       /* magic */
                     72: #define        SELFMAG         4               /* size of magic */
                     73: 
                     74: /* e_ident[] file class */
                     75: #define        ELFCLASSNONE    0               /* invalid */
                     76: #define        ELFCLASS32      1               /* 32-bit objs */
                     77: #define        ELFCLASS64      2               /* 64-bit objs */
                     78: #define        ELFCLASSNUM     3               /* number of classes */
                     79: 
                     80: /* e_ident[] data encoding */
                     81: #define ELFDATANONE    0               /* invalid */
                     82: #define ELFDATA2LSB    1               /* Little-Endian */
                     83: #define ELFDATA2MSB    2               /* Big-Endian */
                     84: #define ELFDATANUM     3               /* number of data encode defines */
                     85: 
                     86: /* e_ident[] Operating System/ABI */
                     87: #define ELFOSABI_SYSV          0       /* UNIX System V ABI */
                     88: #define ELFOSABI_HPUX          1       /* HP-UX operating system */
                     89: #define ELFOSABI_NETBSD                2       /* NetBSD */
                     90: #define ELFOSABI_LINUX         3       /* GNU/Linux */
                     91: #define ELFOSABI_HURD          4       /* GNU/Hurd */
                     92: #define ELFOSABI_86OPEN                5       /* 86Open common IA32 ABI */
                     93: #define ELFOSABI_SOLARIS       6       /* Solaris */
                     94: #define ELFOSABI_MONTEREY      7       /* Monterey */
                     95: #define ELFOSABI_IRIX          8       /* IRIX */
                     96: #define ELFOSABI_FREEBSD       9       /* FreeBSD */
                     97: #define ELFOSABI_TRU64         10      /* TRU64 UNIX */
                     98: #define ELFOSABI_MODESTO       11      /* Novell Modesto */
                     99: #define ELFOSABI_OPENBSD       12      /* OpenBSD */
                    100: #define ELFOSABI_ARM           97      /* ARM */
                    101: #define ELFOSABI_STANDALONE    255     /* Standalone (embedded) application */
                    102: 
                    103: /* e_ident */
                    104: #define IS_ELF(ehdr) ((ehdr).e_ident[EI_MAG0] == ELFMAG0 && \
                    105:                       (ehdr).e_ident[EI_MAG1] == ELFMAG1 && \
                    106:                       (ehdr).e_ident[EI_MAG2] == ELFMAG2 && \
                    107:                       (ehdr).e_ident[EI_MAG3] == ELFMAG3)
                    108: 
                    109: /* ELF Header */
                    110: typedef struct elfhdr {
                    111:        unsigned char   e_ident[EI_NIDENT]; /* ELF Identification */
                    112:        Elf32_Half      e_type;         /* object file type */
                    113:        Elf32_Half      e_machine;      /* machine */
                    114:        Elf32_Word      e_version;      /* object file version */
                    115:        Elf32_Addr      e_entry;        /* virtual entry point */
                    116:        Elf32_Off       e_phoff;        /* program header table offset */
                    117:        Elf32_Off       e_shoff;        /* section header table offset */
                    118:        Elf32_Word      e_flags;        /* processor-specific flags */
                    119:        Elf32_Half      e_ehsize;       /* ELF header size */
                    120:        Elf32_Half      e_phentsize;    /* program header entry size */
                    121:        Elf32_Half      e_phnum;        /* number of program header entries */
                    122:        Elf32_Half      e_shentsize;    /* section header entry size */
                    123:        Elf32_Half      e_shnum;        /* number of section header entries */
                    124:        Elf32_Half      e_shstrndx;     /* section header table's "section
                    125:                                           header string table" entry offset */
                    126: } Elf32_Ehdr;
                    127: 
                    128: typedef struct {
                    129:        unsigned char   e_ident[EI_NIDENT];     /* Id bytes */
                    130:        Elf64_Quarter   e_type;                 /* file type */
                    131:        Elf64_Quarter   e_machine;              /* machine type */
                    132:        Elf64_Half      e_version;              /* version number */
                    133:        Elf64_Addr      e_entry;                /* entry point */
                    134:        Elf64_Off       e_phoff;                /* Program hdr offset */
                    135:        Elf64_Off       e_shoff;                /* Section hdr offset */
                    136:        Elf64_Half      e_flags;                /* Processor flags */
                    137:        Elf64_Quarter   e_ehsize;               /* sizeof ehdr */
                    138:        Elf64_Quarter   e_phentsize;            /* Program header entry size */
                    139:        Elf64_Quarter   e_phnum;                /* Number of program headers */
                    140:        Elf64_Quarter   e_shentsize;            /* Section header entry size */
                    141:        Elf64_Quarter   e_shnum;                /* Number of section headers */
                    142:        Elf64_Quarter   e_shstrndx;             /* String table index */
                    143: } Elf64_Ehdr;
                    144: 
                    145: /* e_type */
                    146: #define ET_NONE                0               /* No file type */
                    147: #define ET_REL         1               /* relocatable file */
                    148: #define ET_EXEC                2               /* executable file */
                    149: #define ET_DYN         3               /* shared object file */
                    150: #define ET_CORE                4               /* core file */
                    151: #define ET_NUM         5               /* number of types */
                    152: #define ET_LOPROC      0xff00          /* reserved range for processor */
                    153: #define ET_HIPROC      0xffff          /*  specific e_type */
                    154: 
                    155: /* e_machine */
                    156: #define EM_NONE                0               /* No Machine */
                    157: #define EM_M32         1               /* AT&T WE 32100 */
                    158: #define EM_SPARC       2               /* SPARC */
                    159: #define EM_386         3               /* Intel 80386 */
                    160: #define EM_68K         4               /* Motorola 68000 */
                    161: #define EM_88K         5               /* Motorola 88000 */
                    162: #define EM_486         6               /* Intel 80486 - unused? */
                    163: #define EM_860         7               /* Intel 80860 */
                    164: #define EM_MIPS                8               /* MIPS R3000 Big-Endian only */
                    165: /*
                    166:  * Don't know if EM_MIPS_RS4_BE,
                    167:  * EM_SPARC64, EM_PARISC,
                    168:  * or EM_PPC are ABI compliant
                    169:  */
                    170: #define EM_MIPS_RS4_BE 10              /* MIPS R4000 Big-Endian */
                    171: #define EM_SPARC64     11              /* SPARC v9 64-bit unoffical */
                    172: #define EM_PARISC      15              /* HPPA */
                    173: #define EM_SPARC32PLUS 18              /* Enhanced instruction set SPARC */
                    174: #define EM_PPC         20              /* PowerPC */
                    175: #define EM_PPC64       21              /* PowerPC 64-bit */
                    176: #define EM_ARM         40              /* Advanced RISC Machines ARM */
                    177: #define EM_ALPHA       41              /* DEC ALPHA */
                    178: #define EM_SPARCV9     43              /* SPARC version 9 */
                    179: #define EM_ALPHA_EXP   0x9026          /* DEC ALPHA */
                    180: #define EM_IA_64       50              /* Intel Merced */
                    181: #define EM_X86_64      62              /* AMD x86-64 architecture */
                    182: #define EM_VAX         75              /* DEC VAX */
                    183: 
                    184: /* Version */
                    185: #define EV_NONE                0               /* Invalid */
                    186: #define EV_CURRENT     1               /* Current */
                    187: #define EV_NUM         2               /* number of versions */
                    188: 
                    189: /* Section Header */
                    190: typedef struct {
                    191:        Elf32_Word      sh_name;        /* name - index into section header
                    192:                                           string table section */
                    193:        Elf32_Word      sh_type;        /* type */
                    194:        Elf32_Word      sh_flags;       /* flags */
                    195:        Elf32_Addr      sh_addr;        /* address */
                    196:        Elf32_Off       sh_offset;      /* file offset */
                    197:        Elf32_Word      sh_size;        /* section size */
                    198:        Elf32_Word      sh_link;        /* section header table index link */
                    199:        Elf32_Word      sh_info;        /* extra information */
                    200:        Elf32_Word      sh_addralign;   /* address alignment */
                    201:        Elf32_Word      sh_entsize;     /* section entry size */
                    202: } Elf32_Shdr;
                    203: 
                    204: typedef struct {
                    205:        Elf64_Half      sh_name;        /* section name */
                    206:        Elf64_Half      sh_type;        /* section type */
                    207:        Elf64_Xword     sh_flags;       /* section flags */
                    208:        Elf64_Addr      sh_addr;        /* virtual address */
                    209:        Elf64_Off       sh_offset;      /* file offset */
                    210:        Elf64_Xword     sh_size;        /* section size */
                    211:        Elf64_Half      sh_link;        /* link to another */
                    212:        Elf64_Half      sh_info;        /* misc info */
                    213:        Elf64_Xword     sh_addralign;   /* memory alignment */
                    214:        Elf64_Xword     sh_entsize;     /* table entry size */
                    215: } Elf64_Shdr;
                    216: 
                    217: /* Special Section Indexes */
                    218: #define SHN_UNDEF      0               /* undefined */
                    219: #define SHN_LORESERVE  0xff00          /* lower bounds of reserved indexes */
                    220: #define SHN_LOPROC     0xff00          /* reserved range for processor */
                    221: #define SHN_HIPROC     0xff1f          /*   specific section indexes */
                    222: #define SHN_ABS                0xfff1          /* absolute value */
                    223: #define SHN_COMMON     0xfff2          /* common symbol */
                    224: #define SHN_HIRESERVE  0xffff          /* upper bounds of reserved indexes */
                    225: 
                    226: /* sh_type */
                    227: #define SHT_NULL       0               /* inactive */
                    228: #define SHT_PROGBITS   1               /* program defined information */
                    229: #define SHT_SYMTAB     2               /* symbol table section */
                    230: #define SHT_STRTAB     3               /* string table section */
                    231: #define SHT_RELA       4               /* relocation section with addends*/
                    232: #define SHT_HASH       5               /* symbol hash table section */
                    233: #define SHT_DYNAMIC    6               /* dynamic section */
                    234: #define SHT_NOTE       7               /* note section */
                    235: #define SHT_NOBITS     8               /* no space section */
                    236: #define SHT_REL                9               /* relation section without addends */
                    237: #define SHT_SHLIB      10              /* reserved - purpose unknown */
                    238: #define SHT_DYNSYM     11              /* dynamic symbol table section */
                    239: #define SHT_NUM                12              /* number of section types */
                    240: #define SHT_LOPROC     0x70000000      /* reserved range for processor */
                    241: #define SHT_HIPROC     0x7fffffff      /*  specific section header types */
                    242: #define SHT_LOUSER     0x80000000      /* reserved range for application */
                    243: #define SHT_HIUSER     0xffffffff      /*  specific indexes */
                    244: 
                    245: /* Section names */
                    246: #define ELF_BSS         ".bss"         /* uninitialized data */
                    247: #define ELF_DATA        ".data"                /* initialized data */
                    248: #define ELF_DEBUG       ".debug"       /* debug */
                    249: #define ELF_DYNAMIC     ".dynamic"     /* dynamic linking information */
                    250: #define ELF_DYNSTR      ".dynstr"      /* dynamic string table */
                    251: #define ELF_DYNSYM      ".dynsym"      /* dynamic symbol table */
                    252: #define ELF_FINI        ".fini"                /* termination code */
                    253: #define ELF_GOT         ".got"         /* global offset table */
                    254: #define ELF_HASH        ".hash"                /* symbol hash table */
                    255: #define ELF_INIT        ".init"                /* initialization code */
                    256: #define ELF_REL_DATA    ".rel.data"    /* relocation data */
                    257: #define ELF_REL_FINI    ".rel.fini"    /* relocation termination code */
                    258: #define ELF_REL_INIT    ".rel.init"    /* relocation initialization code */
                    259: #define ELF_REL_DYN     ".rel.dyn"     /* relocaltion dynamic link info */
                    260: #define ELF_REL_RODATA  ".rel.rodata"  /* relocation read-only data */
                    261: #define ELF_REL_TEXT    ".rel.text"    /* relocation code */
                    262: #define ELF_RODATA      ".rodata"      /* read-only data */
                    263: #define ELF_SHSTRTAB    ".shstrtab"    /* section header string table */
                    264: #define ELF_STRTAB      ".strtab"      /* string table */
                    265: #define ELF_SYMTAB      ".symtab"      /* symbol table */
                    266: #define ELF_TEXT        ".text"                /* code */
                    267: 
                    268: 
                    269: /* Section Attribute Flags - sh_flags */
                    270: #define SHF_WRITE      0x1             /* Writable */
                    271: #define SHF_ALLOC      0x2             /* occupies memory */
                    272: #define SHF_EXECINSTR  0x4             /* executable */
                    273: #define SHF_MASKPROC   0xf0000000      /* reserved bits for processor */
                    274:                                        /*  specific section attributes */
                    275: 
                    276: /* Symbol Table Entry */
                    277: typedef struct elf32_sym {
                    278:        Elf32_Word      st_name;        /* name - index into string table */
                    279:        Elf32_Addr      st_value;       /* symbol value */
                    280:        Elf32_Word      st_size;        /* symbol size */
                    281:        unsigned char   st_info;        /* type and binding */
                    282:        unsigned char   st_other;       /* 0 - no defined meaning */
                    283:        Elf32_Half      st_shndx;       /* section header index */
                    284: } Elf32_Sym;
                    285: 
                    286: typedef struct {
                    287:        Elf64_Half      st_name;        /* Symbol name index in str table */
                    288:        Elf_Byte        st_info;        /* type / binding attrs */
                    289:        Elf_Byte        st_other;       /* unused */
                    290:        Elf64_Quarter   st_shndx;       /* section index of symbol */
                    291:        Elf64_Xword     st_value;       /* value of symbol */
                    292:        Elf64_Xword     st_size;        /* size of symbol */
                    293: } Elf64_Sym;
                    294: 
                    295: /* Symbol table index */
                    296: #define STN_UNDEF      0               /* undefined */
                    297: 
                    298: /* Extract symbol info - st_info */
                    299: #define ELF32_ST_BIND(x)       ((x) >> 4)
                    300: #define ELF32_ST_TYPE(x)       (((unsigned int) x) & 0xf)
                    301: #define ELF32_ST_INFO(b,t)     (((b) << 4) + ((t) & 0xf))
                    302: 
                    303: #define ELF64_ST_BIND(x)       ((x) >> 4)
                    304: #define ELF64_ST_TYPE(x)       (((unsigned int) x) & 0xf)
                    305: #define ELF64_ST_INFO(b,t)     (((b) << 4) + ((t) & 0xf))
                    306: 
                    307: /* Symbol Binding - ELF32_ST_BIND - st_info */
                    308: #define STB_LOCAL      0               /* Local symbol */
                    309: #define STB_GLOBAL     1               /* Global symbol */
                    310: #define STB_WEAK       2               /* like global - lower precedence */
                    311: #define STB_NUM                3               /* number of symbol bindings */
                    312: #define STB_LOPROC     13              /* reserved range for processor */
                    313: #define STB_HIPROC     15              /*  specific symbol bindings */
                    314: 
                    315: /* Symbol type - ELF32_ST_TYPE - st_info */
                    316: #define STT_NOTYPE     0               /* not specified */
                    317: #define STT_OBJECT     1               /* data object */
                    318: #define STT_FUNC       2               /* function */
                    319: #define STT_SECTION    3               /* section */
                    320: #define STT_FILE       4               /* file */
                    321: #define STT_NUM                5               /* number of symbol types */
                    322: #define STT_LOPROC     13              /* reserved range for processor */
                    323: #define STT_HIPROC     15              /*  specific symbol types */
                    324: 
                    325: /* Relocation entry with implicit addend */
                    326: typedef struct {
                    327:        Elf32_Addr      r_offset;       /* offset of relocation */
                    328:        Elf32_Word      r_info;         /* symbol table index and type */
                    329: } Elf32_Rel;
                    330: 
                    331: /* Relocation entry with explicit addend */
                    332: typedef struct {
                    333:        Elf32_Addr      r_offset;       /* offset of relocation */
                    334:        Elf32_Word      r_info;         /* symbol table index and type */
                    335:        Elf32_Sword     r_addend;
                    336: } Elf32_Rela;
                    337: 
                    338: /* Extract relocation info - r_info */
                    339: #define ELF32_R_SYM(i)         ((i) >> 8)
                    340: #define ELF32_R_TYPE(i)                ((unsigned char) (i))
                    341: #define ELF32_R_INFO(s,t)      (((s) << 8) + (unsigned char)(t))
                    342: 
                    343: typedef struct {
                    344:        Elf64_Xword     r_offset;       /* where to do it */
                    345:        Elf64_Xword     r_info;         /* index & type of relocation */
                    346: } Elf64_Rel;
                    347: 
                    348: typedef struct {
                    349:        Elf64_Xword     r_offset;       /* where to do it */
                    350:        Elf64_Xword     r_info;         /* index & type of relocation */
                    351:        Elf64_Sxword    r_addend;       /* adjustment value */
                    352: } Elf64_Rela;
                    353: 
                    354: #define        ELF64_R_SYM(info)       ((info) >> 32)
                    355: #define        ELF64_R_TYPE(info)      ((info) & 0xFFFFFFFF)
1.1.1.2 ! root      356: #define ELF64_R_INFO(s,t)      (((s) << 32) + (uint32_t)(t))
1.1       root      357: 
                    358: /* Program Header */
                    359: typedef struct {
                    360:        Elf32_Word      p_type;         /* segment type */
                    361:        Elf32_Off       p_offset;       /* segment offset */
                    362:        Elf32_Addr      p_vaddr;        /* virtual address of segment */
                    363:        Elf32_Addr      p_paddr;        /* physical address - ignored? */
                    364:        Elf32_Word      p_filesz;       /* number of bytes in file for seg. */
                    365:        Elf32_Word      p_memsz;        /* number of bytes in mem. for seg. */
                    366:        Elf32_Word      p_flags;        /* flags */
                    367:        Elf32_Word      p_align;        /* memory alignment */
                    368: } Elf32_Phdr;
                    369: 
                    370: typedef struct {
                    371:        Elf64_Half      p_type;         /* entry type */
                    372:        Elf64_Half      p_flags;        /* flags */
                    373:        Elf64_Off       p_offset;       /* offset */
                    374:        Elf64_Addr      p_vaddr;        /* virtual address */
                    375:        Elf64_Addr      p_paddr;        /* physical address */
                    376:        Elf64_Xword     p_filesz;       /* file size */
                    377:        Elf64_Xword     p_memsz;        /* memory size */
                    378:        Elf64_Xword     p_align;        /* memory & file alignment */
                    379: } Elf64_Phdr;
                    380: 
                    381: /* Segment types - p_type */
                    382: #define PT_NULL                0               /* unused */
                    383: #define PT_LOAD                1               /* loadable segment */
                    384: #define PT_DYNAMIC     2               /* dynamic linking section */
                    385: #define PT_INTERP      3               /* the RTLD */
                    386: #define PT_NOTE                4               /* auxiliary information */
                    387: #define PT_SHLIB       5               /* reserved - purpose undefined */
                    388: #define PT_PHDR                6               /* program header */
                    389: #define PT_NUM         7               /* Number of segment types */
                    390: #define PT_LOPROC      0x70000000      /* reserved range for processor */
                    391: #define PT_HIPROC      0x7fffffff      /*  specific segment types */
                    392: 
                    393: /* Segment flags - p_flags */
                    394: #define PF_X           0x1             /* Executable */
                    395: #define PF_W           0x2             /* Writable */
                    396: #define PF_R           0x4             /* Readable */
                    397: #define PF_MASKPROC    0xf0000000      /* reserved bits for processor */
                    398:                                        /*  specific segment flags */
                    399: 
                    400: /* Dynamic structure */
                    401: typedef struct {
                    402:        Elf32_Sword     d_tag;          /* controls meaning of d_val */
                    403:        union {
                    404:                Elf32_Word      d_val;  /* Multiple meanings - see d_tag */
                    405:                Elf32_Addr      d_ptr;  /* program virtual address */
                    406:        } d_un;
                    407: } Elf32_Dyn;
                    408: 
                    409: typedef struct {
                    410:        Elf64_Xword     d_tag;          /* controls meaning of d_val */
                    411:        union {
                    412:                Elf64_Addr      d_ptr;
                    413:                Elf64_Xword     d_val;
                    414:        } d_un;
                    415: } Elf64_Dyn;
                    416: 
                    417: /* Dynamic Array Tags - d_tag */
                    418: #define DT_NULL                0               /* marks end of _DYNAMIC array */
                    419: #define DT_NEEDED      1               /* string table offset of needed lib */
                    420: #define DT_PLTRELSZ    2               /* size of relocation entries in PLT */
                    421: #define DT_PLTGOT      3               /* address PLT/GOT */
                    422: #define DT_HASH                4               /* address of symbol hash table */
                    423: #define DT_STRTAB      5               /* address of string table */
                    424: #define DT_SYMTAB      6               /* address of symbol table */
                    425: #define DT_RELA                7               /* address of relocation table */
                    426: #define DT_RELASZ      8               /* size of relocation table */
                    427: #define DT_RELAENT     9               /* size of relocation entry */
                    428: #define DT_STRSZ       10              /* size of string table */
                    429: #define DT_SYMENT      11              /* size of symbol table entry */
                    430: #define DT_INIT                12              /* address of initialization func. */
                    431: #define DT_FINI                13              /* address of termination function */
                    432: #define DT_SONAME      14              /* string table offset of shared obj */
                    433: #define DT_RPATH       15              /* string table offset of library
                    434:                                           search path */
                    435: #define DT_SYMBOLIC    16              /* start sym search in shared obj. */
                    436: #define DT_REL         17              /* address of rel. tbl. w addends */
                    437: #define DT_RELSZ       18              /* size of DT_REL relocation table */
                    438: #define DT_RELENT      19              /* size of DT_REL relocation entry */
                    439: #define DT_PLTREL      20              /* PLT referenced relocation entry */
                    440: #define DT_DEBUG       21              /* bugger */
                    441: #define DT_TEXTREL     22              /* Allow rel. mod. to unwritable seg */
                    442: #define DT_JMPREL      23              /* add. of PLT's relocation entries */
                    443: #define DT_BIND_NOW    24              /* Bind now regardless of env setting */
                    444: #define DT_NUM         25              /* Number used. */
                    445: #define DT_LOPROC      0x70000000      /* reserved range for processor */
                    446: #define DT_HIPROC      0x7fffffff      /*  specific dynamic array tags */
                    447: 
                    448: /* Standard ELF hashing function */
                    449: unsigned int elf_hash(const unsigned char *name);
                    450: 
                    451: /*
                    452:  * Note Definitions
                    453:  */
                    454: typedef struct {
                    455:        Elf32_Word namesz;
                    456:        Elf32_Word descsz;
                    457:        Elf32_Word type;
                    458: } Elf32_Note;
                    459: 
                    460: typedef struct {
                    461:        Elf64_Half namesz;
                    462:        Elf64_Half descsz;
                    463:        Elf64_Half type;
                    464: } Elf64_Note;
                    465: 
                    466: 
                    467: #if defined(ELFSIZE)
                    468: #define CONCAT(x,y)    __CONCAT(x,y)
                    469: #define ELFNAME(x)     CONCAT(elf,CONCAT(ELFSIZE,CONCAT(_,x)))
                    470: #define ELFNAME2(x,y)  CONCAT(x,CONCAT(_elf,CONCAT(ELFSIZE,CONCAT(_,y))))
                    471: #define ELFNAMEEND(x)  CONCAT(x,CONCAT(_elf,ELFSIZE))
                    472: #define ELFDEFNNAME(x) CONCAT(ELF,CONCAT(ELFSIZE,CONCAT(_,x)))
                    473: #endif
                    474: 
                    475: #if defined(ELFSIZE) && (ELFSIZE == 32)
                    476: #define Elf_Ehdr       Elf32_Ehdr
                    477: #define Elf_Phdr       Elf32_Phdr
                    478: #define Elf_Shdr       Elf32_Shdr
                    479: #define Elf_Sym                Elf32_Sym
                    480: #define Elf_Rel                Elf32_Rel
                    481: #define Elf_RelA       Elf32_Rela
                    482: #define Elf_Dyn                Elf32_Dyn
                    483: #define Elf_Word       Elf32_Word
                    484: #define Elf_Sword      Elf32_Sword
                    485: #define Elf_Addr       Elf32_Addr
                    486: #define Elf_Off                Elf32_Off
                    487: #define Elf_Nhdr       Elf32_Nhdr
                    488: #define Elf_Note       Elf32_Note
                    489: 
                    490: #define ELF_R_SYM      ELF32_R_SYM
                    491: #define ELF_R_TYPE     ELF32_R_TYPE
                    492: #define ELF_R_INFO     ELF32_R_INFO
                    493: #define ELFCLASS       ELFCLASS32
                    494: 
                    495: #define ELF_ST_BIND    ELF32_ST_BIND
                    496: #define ELF_ST_TYPE    ELF32_ST_TYPE
                    497: #define ELF_ST_INFO    ELF32_ST_INFO
                    498: 
                    499: #define AuxInfo                Aux32Info
                    500: #elif defined(ELFSIZE) && (ELFSIZE == 64)
                    501: #define Elf_Ehdr       Elf64_Ehdr
                    502: #define Elf_Phdr       Elf64_Phdr
                    503: #define Elf_Shdr       Elf64_Shdr
                    504: #define Elf_Sym                Elf64_Sym
                    505: #define Elf_Rel                Elf64_Rel
                    506: #define Elf_RelA       Elf64_Rela
                    507: #define Elf_Dyn                Elf64_Dyn
                    508: #define Elf_Word       Elf64_Word
                    509: #define Elf_Sword      Elf64_Sword
                    510: #define Elf_Addr       Elf64_Addr
                    511: #define Elf_Off                Elf64_Off
                    512: #define Elf_Nhdr       Elf64_Nhdr
                    513: #define Elf_Note       Elf64_Note
                    514: 
                    515: #define ELF_R_SYM      ELF64_R_SYM
                    516: #define ELF_R_TYPE     ELF64_R_TYPE
                    517: #define ELF_R_INFO     ELF64_R_INFO
                    518: #define ELFCLASS       ELFCLASS64
                    519: 
                    520: #define ELF_ST_BIND    ELF64_ST_BIND
                    521: #define ELF_ST_TYPE    ELF64_ST_TYPE
                    522: #define ELF_ST_INFO    ELF64_ST_INFO
                    523: 
                    524: #define AuxInfo                Aux64Info
                    525: #endif
                    526: 
                    527: #endif /* __XEN_PUBLIC_ELFSTRUCTS_H__ */

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.