1 /****************************************************************************
2 ****************************************************************************
4 *** This header was automatically generated from a Linux kernel header
5 *** of the same name, to make information necessary for userspace to
6 *** call into the kernel available to libc. It contains only constants,
7 *** structures, and macros generated from the original header, and thus,
8 *** contains no copyrightable information.
10 ****************************************************************************
11 ****************************************************************************/
15 #include <linux/types.h>
16 #include <linux/auxvec.h>
17 #include <linux/elf-em.h>
20 #ifndef elf_read_implies_exec
22 #define elf_read_implies_exec(ex, have_pt_gnu_stack) 0
25 typedef __u32 Elf32_Addr;
26 typedef __u16 Elf32_Half;
27 typedef __u32 Elf32_Off;
28 typedef __s32 Elf32_Sword;
29 typedef __u32 Elf32_Word;
31 typedef __u64 Elf64_Addr;
32 typedef __u16 Elf64_Half;
33 typedef __s16 Elf64_SHalf;
34 typedef __u64 Elf64_Off;
35 typedef __s32 Elf64_Sword;
36 typedef __u32 Elf64_Word;
37 typedef __u64 Elf64_Xword;
38 typedef __s64 Elf64_Sxword;
48 #define PT_LOOS 0x60000000
49 #define PT_HIOS 0x6fffffff
50 #define PT_LOPROC 0x70000000
51 #define PT_HIPROC 0x7fffffff
52 #define PT_GNU_EH_FRAME 0x6474e550
54 #define PT_GNU_STACK (PT_LOOS + 0x474e551)
61 #define ET_LOPROC 0xff00
62 #define ET_HIPROC 0xffff
80 #define DT_SYMBOLIC 16
88 #define DT_LOPROC 0x70000000
89 #define DT_HIPROC 0x7fffffff
103 #define ELF_ST_BIND(x) ((x) >> 4)
104 #define ELF_ST_TYPE(x) (((unsigned int) x) & 0xf)
105 #define ELF32_ST_BIND(x) ELF_ST_BIND(x)
106 #define ELF32_ST_TYPE(x) ELF_ST_TYPE(x)
107 #define ELF64_ST_BIND(x) ELF_ST_BIND(x)
108 #define ELF64_ST_TYPE(x) ELF_ST_TYPE(x)
110 typedef struct dynamic{
126 #define ELF32_R_SYM(x) ((x) >> 8)
127 #define ELF32_R_TYPE(x) ((x) & 0xff)
129 #define ELF64_R_SYM(i) ((i) >> 32)
130 #define ELF64_R_TYPE(i) ((i) & 0xffffffff)
132 typedef struct elf32_rel {
137 typedef struct elf64_rel {
142 typedef struct elf32_rela{
145 Elf32_Sword r_addend;
148 typedef struct elf64_rela {
151 Elf64_Sxword r_addend;
154 typedef struct elf32_sym{
158 unsigned char st_info;
159 unsigned char st_other;
163 typedef struct elf64_sym {
165 unsigned char st_info;
166 unsigned char st_other;
174 typedef struct elf32_hdr{
175 unsigned char e_ident[EI_NIDENT];
177 Elf32_Half e_machine;
178 Elf32_Word e_version;
184 Elf32_Half e_phentsize;
186 Elf32_Half e_shentsize;
188 Elf32_Half e_shstrndx;
191 typedef struct elf64_hdr {
192 unsigned char e_ident[16];
194 Elf64_Half e_machine;
195 Elf64_Word e_version;
201 Elf64_Half e_phentsize;
203 Elf64_Half e_shentsize;
205 Elf64_Half e_shstrndx;
212 typedef struct elf32_phdr{
223 typedef struct elf64_phdr {
229 Elf64_Xword p_filesz;
235 #define SHT_PROGBITS 1
240 #define SHT_DYNAMIC 6
245 #define SHT_DYNSYM 11
247 #define SHT_LOPROC 0x70000000
248 #define SHT_HIPROC 0x7fffffff
249 #define SHT_LOUSER 0x80000000
250 #define SHT_HIUSER 0xffffffff
252 #define SHF_WRITE 0x1
253 #define SHF_ALLOC 0x2
254 #define SHF_EXECINSTR 0x4
255 #define SHF_MASKPROC 0xf0000000
258 #define SHN_LORESERVE 0xff00
259 #define SHN_LOPROC 0xff00
260 #define SHN_HIPROC 0xff1f
261 #define SHN_ABS 0xfff1
262 #define SHN_COMMON 0xfff2
263 #define SHN_HIRESERVE 0xffff
274 Elf32_Word sh_addralign;
275 Elf32_Word sh_entsize;
278 typedef struct elf64_shdr {
281 Elf64_Xword sh_flags;
287 Elf64_Xword sh_addralign;
288 Elf64_Xword sh_entsize;
305 #define ELFMAG "\177ELF"
308 #define ELFCLASSNONE 0
311 #define ELFCLASSNUM 3
313 #define ELFDATANONE 0
314 #define ELFDATA2LSB 1
315 #define ELFDATA2MSB 2
321 #define ELFOSABI_NONE 0
322 #define ELFOSABI_LINUX 3
325 #define ELF_OSABI ELFOSABI_NONE
328 #define NT_PRSTATUS 1
330 #define NT_PRPSINFO 3
331 #define NT_TASKSTRUCT 4
333 #define NT_PRXFPREG 0x46e62b7f
335 typedef struct elf32_note {
341 typedef struct elf64_note {
347 #if ELF_CLASS == ELFCLASS32
349 #define elfhdr elf32_hdr
350 #define elf_phdr elf32_phdr
351 #define elf_note elf32_note
355 #define elfhdr elf64_hdr
356 #define elf_phdr elf64_phdr
357 #define elf_note elf64_note