3 * @(#)$Id: readelf.h,v 1.7 1999/02/14 17:16:11 christos Exp $
5 * Provide elf data structures for non-elf machines, allowing file
6 * non-elf hosts to determine if an elf binary is stripped.
7 * Note: cobbled from the linux header file, with modifications
10 #define __fake_elf_h__
12 typedef uint32_t Elf32_Addr;
13 typedef uint32_t Elf32_Off;
14 typedef uint16_t Elf32_Half;
15 typedef uint32_t Elf32_Word;
16 typedef uint8_t Elf32_Char;
18 #if SIZEOF_UINT64_T != 8
19 #define USE_ARRAY_FOR_64BIT_TYPES
20 typedef uint32_t Elf64_Addr[2];
21 typedef uint32_t Elf64_Off[2];
22 typedef uint32_t Elf64_Xword[2];
24 typedef uint64_t Elf64_Addr;
25 typedef uint64_t Elf64_Off;
26 typedef uint64_t Elf64_Xword;
28 typedef uint16_t Elf64_Half;
29 typedef uint32_t Elf64_Word;
30 typedef uint8_t Elf64_Char;
35 Elf32_Char e_ident[EI_NIDENT];
39 Elf32_Addr e_entry; /* Entry point */
44 Elf32_Half e_phentsize;
46 Elf32_Half e_shentsize;
48 Elf32_Half e_shstrndx;
52 Elf64_Char e_ident[EI_NIDENT];
56 Elf64_Addr e_entry; /* Entry point */
61 Elf64_Half e_phentsize;
63 Elf64_Half e_shentsize;
65 Elf64_Half e_shstrndx;
78 #define ELFDATANONE 0 /* e_ident[EI_DATA] */
83 #define ELFCLASSNONE 0
88 #define EI_MAG0 0 /* e_ident[] indexes */
97 #define ELFMAG0 0x7f /* EI_MAG */
101 #define ELFMAG "\177ELF"
104 #define OLFMAG "\177OLF"
123 Elf64_Xword p_filesz;
128 #define PT_NULL 0 /* p_type */
146 Elf32_Word sh_addralign;
147 Elf32_Word sh_entsize;
159 Elf64_Off sh_addralign;
160 Elf64_Off sh_entsize;
163 /* Notes used in ET_CORE */
164 #define NT_PRSTATUS 1
166 #define NT_PRPSINFO 3
167 #define NT_TASKSTRUCT 4
169 /* Note header in a PT_NOTE section */
170 typedef struct elf_note {
171 Elf32_Word n_namesz; /* Name size */
172 Elf32_Word n_descsz; /* Content size */
173 Elf32_Word n_type; /* Content type */
182 #define NT_PRSTATUS 1
184 #define NT_PRPSINFO 3
186 #define NT_PLATFORM 5