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 unsigned int Elf32_Addr;
13 typedef unsigned short Elf32_Half;
14 typedef unsigned int Elf32_Off;
15 typedef unsigned int Elf32_Word;
16 typedef unsigned char Elf32_Char;
18 /* XXX: We need 64 bit numbers here */
19 typedef u_quad_t Elf64_Addr;
20 typedef unsigned short Elf64_Half;
21 typedef u_quad_t Elf64_Off;
22 typedef unsigned int Elf64_Word;
23 typedef unsigned char Elf64_Char;
28 Elf32_Char e_ident[EI_NIDENT];
32 Elf32_Addr e_entry; /* Entry point */
37 Elf32_Half e_phentsize;
39 Elf32_Half e_shentsize;
41 Elf32_Half e_shstrndx;
45 Elf64_Char e_ident[EI_NIDENT];
49 Elf64_Addr e_entry; /* Entry point */
54 Elf64_Half e_phentsize;
56 Elf64_Half e_shentsize;
58 Elf64_Half e_shstrndx;
70 #define ELFDATANONE 0 /* e_ident[EI_DATA] */
75 #define ELFCLASSNONE 0
80 #define EI_MAG0 0 /* e_ident[] indexes */
89 #define ELFMAG0 0x7f /* EI_MAG */
93 #define ELFMAG "\177ELF"
106 #define PT_NULL 0 /* p_type */
124 Elf32_Word sh_addralign;
125 Elf32_Word sh_entsize;
137 Elf64_Off sh_addralign;
138 Elf64_Off sh_entsize;
141 /* Notes used in ET_CORE */
142 #define NT_PRSTATUS 1
144 #define NT_PRPSINFO 3
145 #define NT_TASKSTRUCT 4
147 /* Note header in a PT_NOTE section */
148 typedef struct elf_note {
149 Elf32_Word n_namesz; /* Name size */
150 Elf32_Word n_descsz; /* Content size */
151 Elf32_Word n_type; /* Content type */
160 #define NT_PRSTATUS 1
162 #define NT_PRPSINFO 3
164 #define NT_PLATFORM 5