elf.h revision 106b3a8a7dc03c19a45e322de425ac56aafac358
1/****************************************************************************
2 ****************************************************************************
3 ***
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.
9 ***
10 ***   To edit the content of this header, modify the corresponding
11 ***   source file (e.g. under external/kernel-headers/original/) then
12 ***   run bionic/libc/kernel/tools/update_all.py
13 ***
14 ***   Any manual change here will be lost the next time this script will
15 ***   be run. You've been warned!
16 ***
17 ****************************************************************************
18 ****************************************************************************/
19#ifndef _UAPI_LINUX_ELF_H
20#define _UAPI_LINUX_ELF_H
21#include <linux/types.h>
22#include <linux/elf-em.h>
23/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
24typedef __u32 Elf32_Addr;
25typedef __u16 Elf32_Half;
26typedef __u32 Elf32_Off;
27typedef __s32 Elf32_Sword;
28/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
29typedef __u32 Elf32_Word;
30typedef __u64 Elf64_Addr;
31typedef __u16 Elf64_Half;
32typedef __s16 Elf64_SHalf;
33/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
34typedef __u64 Elf64_Off;
35typedef __s32 Elf64_Sword;
36typedef __u32 Elf64_Word;
37typedef __u64 Elf64_Xword;
38/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
39typedef __s64 Elf64_Sxword;
40#define PT_NULL 0
41#define PT_LOAD 1
42#define PT_DYNAMIC 2
43/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
44#define PT_INTERP 3
45#define PT_NOTE 4
46#define PT_SHLIB 5
47#define PT_PHDR 6
48/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
49#define PT_TLS 7
50#define PT_LOOS 0x60000000
51#define PT_HIOS 0x6fffffff
52#define PT_LOPROC 0x70000000
53/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
54#define PT_HIPROC 0x7fffffff
55#define PT_GNU_EH_FRAME 0x6474e550
56#define PT_GNU_STACK (PT_LOOS + 0x474e551)
57#define PN_XNUM 0xffff
58/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
59#define ET_NONE 0
60#define ET_REL 1
61#define ET_EXEC 2
62#define ET_DYN 3
63/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
64#define ET_CORE 4
65#define ET_LOPROC 0xff00
66#define ET_HIPROC 0xffff
67#define DT_NULL 0
68/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
69#define DT_NEEDED 1
70#define DT_PLTRELSZ 2
71#define DT_PLTGOT 3
72#define DT_HASH 4
73/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
74#define DT_STRTAB 5
75#define DT_SYMTAB 6
76#define DT_RELA 7
77#define DT_RELASZ 8
78/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
79#define DT_RELAENT 9
80#define DT_STRSZ 10
81#define DT_SYMENT 11
82#define DT_INIT 12
83/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
84#define DT_FINI 13
85#define DT_SONAME 14
86#define DT_RPATH 15
87#define DT_SYMBOLIC 16
88/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
89#define DT_REL 17
90#define DT_RELSZ 18
91#define DT_RELENT 19
92#define DT_PLTREL 20
93/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
94#define DT_DEBUG 21
95#define DT_TEXTREL 22
96#define DT_JMPREL 23
97#define DT_ENCODING 32
98/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
99#define OLD_DT_LOOS 0x60000000
100#define DT_LOOS 0x6000000d
101#define DT_HIOS 0x6ffff000
102#define DT_VALRNGLO 0x6ffffd00
103/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
104#define DT_VALRNGHI 0x6ffffdff
105#define DT_ADDRRNGLO 0x6ffffe00
106#define DT_ADDRRNGHI 0x6ffffeff
107#define DT_VERSYM 0x6ffffff0
108/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
109#define DT_RELACOUNT 0x6ffffff9
110#define DT_RELCOUNT 0x6ffffffa
111#define DT_FLAGS_1 0x6ffffffb
112#define DT_VERDEF 0x6ffffffc
113/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
114#define DT_VERDEFNUM 0x6ffffffd
115#define DT_VERNEED 0x6ffffffe
116#define DT_VERNEEDNUM 0x6fffffff
117#define OLD_DT_HIOS 0x6fffffff
118/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
119#define DT_LOPROC 0x70000000
120#define DT_HIPROC 0x7fffffff
121#define STB_LOCAL 0
122#define STB_GLOBAL 1
123/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
124#define STB_WEAK 2
125#define STT_NOTYPE 0
126#define STT_OBJECT 1
127#define STT_FUNC 2
128/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
129#define STT_SECTION 3
130#define STT_FILE 4
131#define STT_COMMON 5
132#define STT_TLS 6
133/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
134#define ELF_ST_BIND(x) ((x) >> 4)
135#define ELF_ST_TYPE(x) (((unsigned int) x) & 0xf)
136#define ELF32_ST_BIND(x) ELF_ST_BIND(x)
137#define ELF32_ST_TYPE(x) ELF_ST_TYPE(x)
138/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
139#define ELF64_ST_BIND(x) ELF_ST_BIND(x)
140#define ELF64_ST_TYPE(x) ELF_ST_TYPE(x)
141typedef struct dynamic {
142  Elf32_Sword d_tag;
143/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
144  union {
145    Elf32_Sword d_val;
146    Elf32_Addr d_ptr;
147  } d_un;
148/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
149} Elf32_Dyn;
150typedef struct {
151  Elf64_Sxword d_tag;
152  union {
153/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
154    Elf64_Xword d_val;
155    Elf64_Addr d_ptr;
156  } d_un;
157} Elf64_Dyn;
158/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
159#define ELF32_R_SYM(x) ((x) >> 8)
160#define ELF32_R_TYPE(x) ((x) & 0xff)
161#define ELF64_R_SYM(i) ((i) >> 32)
162#define ELF64_R_TYPE(i) ((i) & 0xffffffff)
163/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
164typedef struct elf32_rel {
165  Elf32_Addr r_offset;
166  Elf32_Word r_info;
167} Elf32_Rel;
168/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
169typedef struct elf64_rel {
170  Elf64_Addr r_offset;
171  Elf64_Xword r_info;
172} Elf64_Rel;
173/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
174typedef struct elf32_rela {
175  Elf32_Addr r_offset;
176  Elf32_Word r_info;
177  Elf32_Sword r_addend;
178/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
179} Elf32_Rela;
180typedef struct elf64_rela {
181  Elf64_Addr r_offset;
182  Elf64_Xword r_info;
183/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
184  Elf64_Sxword r_addend;
185} Elf64_Rela;
186typedef struct elf32_sym {
187  Elf32_Word st_name;
188/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
189  Elf32_Addr st_value;
190  Elf32_Word st_size;
191  unsigned char st_info;
192  unsigned char st_other;
193/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
194  Elf32_Half st_shndx;
195} Elf32_Sym;
196typedef struct elf64_sym {
197  Elf64_Word st_name;
198/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
199  unsigned char st_info;
200  unsigned char st_other;
201  Elf64_Half st_shndx;
202  Elf64_Addr st_value;
203/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
204  Elf64_Xword st_size;
205} Elf64_Sym;
206#define EI_NIDENT 16
207typedef struct elf32_hdr {
208/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
209  unsigned char e_ident[EI_NIDENT];
210  Elf32_Half e_type;
211  Elf32_Half e_machine;
212  Elf32_Word e_version;
213/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
214  Elf32_Addr e_entry;
215  Elf32_Off e_phoff;
216  Elf32_Off e_shoff;
217  Elf32_Word e_flags;
218/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
219  Elf32_Half e_ehsize;
220  Elf32_Half e_phentsize;
221  Elf32_Half e_phnum;
222  Elf32_Half e_shentsize;
223/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
224  Elf32_Half e_shnum;
225  Elf32_Half e_shstrndx;
226} Elf32_Ehdr;
227typedef struct elf64_hdr {
228/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
229  unsigned char e_ident[EI_NIDENT];
230  Elf64_Half e_type;
231  Elf64_Half e_machine;
232  Elf64_Word e_version;
233/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
234  Elf64_Addr e_entry;
235  Elf64_Off e_phoff;
236  Elf64_Off e_shoff;
237  Elf64_Word e_flags;
238/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
239  Elf64_Half e_ehsize;
240  Elf64_Half e_phentsize;
241  Elf64_Half e_phnum;
242  Elf64_Half e_shentsize;
243/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
244  Elf64_Half e_shnum;
245  Elf64_Half e_shstrndx;
246} Elf64_Ehdr;
247#define PF_R 0x4
248/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
249#define PF_W 0x2
250#define PF_X 0x1
251typedef struct elf32_phdr {
252  Elf32_Word p_type;
253/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
254  Elf32_Off p_offset;
255  Elf32_Addr p_vaddr;
256  Elf32_Addr p_paddr;
257  Elf32_Word p_filesz;
258/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
259  Elf32_Word p_memsz;
260  Elf32_Word p_flags;
261  Elf32_Word p_align;
262} Elf32_Phdr;
263/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
264typedef struct elf64_phdr {
265  Elf64_Word p_type;
266  Elf64_Word p_flags;
267  Elf64_Off p_offset;
268/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
269  Elf64_Addr p_vaddr;
270  Elf64_Addr p_paddr;
271  Elf64_Xword p_filesz;
272  Elf64_Xword p_memsz;
273/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
274  Elf64_Xword p_align;
275} Elf64_Phdr;
276#define SHT_NULL 0
277#define SHT_PROGBITS 1
278/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
279#define SHT_SYMTAB 2
280#define SHT_STRTAB 3
281#define SHT_RELA 4
282#define SHT_HASH 5
283/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
284#define SHT_DYNAMIC 6
285#define SHT_NOTE 7
286#define SHT_NOBITS 8
287#define SHT_REL 9
288/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
289#define SHT_SHLIB 10
290#define SHT_DYNSYM 11
291#define SHT_NUM 12
292#define SHT_LOPROC 0x70000000
293/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
294#define SHT_HIPROC 0x7fffffff
295#define SHT_LOUSER 0x80000000
296#define SHT_HIUSER 0xffffffff
297#define SHF_WRITE 0x1
298/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
299#define SHF_ALLOC 0x2
300#define SHF_EXECINSTR 0x4
301#define SHF_RELA_LIVEPATCH 0x00100000
302#define SHF_MASKPROC 0xf0000000
303/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
304#define SHN_UNDEF 0
305#define SHN_LORESERVE 0xff00
306#define SHN_LOPROC 0xff00
307#define SHN_HIPROC 0xff1f
308/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
309#define SHN_LIVEPATCH 0xff20
310#define SHN_ABS 0xfff1
311#define SHN_COMMON 0xfff2
312#define SHN_HIRESERVE 0xffff
313/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
314typedef struct elf32_shdr {
315  Elf32_Word sh_name;
316  Elf32_Word sh_type;
317  Elf32_Word sh_flags;
318/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
319  Elf32_Addr sh_addr;
320  Elf32_Off sh_offset;
321  Elf32_Word sh_size;
322  Elf32_Word sh_link;
323/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
324  Elf32_Word sh_info;
325  Elf32_Word sh_addralign;
326  Elf32_Word sh_entsize;
327} Elf32_Shdr;
328/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
329typedef struct elf64_shdr {
330  Elf64_Word sh_name;
331  Elf64_Word sh_type;
332  Elf64_Xword sh_flags;
333/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
334  Elf64_Addr sh_addr;
335  Elf64_Off sh_offset;
336  Elf64_Xword sh_size;
337  Elf64_Word sh_link;
338/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
339  Elf64_Word sh_info;
340  Elf64_Xword sh_addralign;
341  Elf64_Xword sh_entsize;
342} Elf64_Shdr;
343/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
344#define EI_MAG0 0
345#define EI_MAG1 1
346#define EI_MAG2 2
347#define EI_MAG3 3
348/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
349#define EI_CLASS 4
350#define EI_DATA 5
351#define EI_VERSION 6
352#define EI_OSABI 7
353/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
354#define EI_PAD 8
355#define ELFMAG0 0x7f
356#define ELFMAG1 'E'
357#define ELFMAG2 'L'
358/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
359#define ELFMAG3 'F'
360#define ELFMAG "\177ELF"
361#define SELFMAG 4
362#define ELFCLASSNONE 0
363/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
364#define ELFCLASS32 1
365#define ELFCLASS64 2
366#define ELFCLASSNUM 3
367#define ELFDATANONE 0
368/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
369#define ELFDATA2LSB 1
370#define ELFDATA2MSB 2
371#define EV_NONE 0
372#define EV_CURRENT 1
373/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
374#define EV_NUM 2
375#define ELFOSABI_NONE 0
376#define ELFOSABI_LINUX 3
377#ifndef ELF_OSABI
378/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
379#define ELF_OSABI ELFOSABI_NONE
380#endif
381#define NT_PRSTATUS 1
382#define NT_PRFPREG 2
383/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
384#define NT_PRPSINFO 3
385#define NT_TASKSTRUCT 4
386#define NT_AUXV 6
387#define NT_SIGINFO 0x53494749
388/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
389#define NT_FILE 0x46494c45
390#define NT_PRXFPREG 0x46e62b7f
391#define NT_PPC_VMX 0x100
392#define NT_PPC_SPE 0x101
393/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
394#define NT_PPC_VSX 0x102
395#define NT_386_TLS 0x200
396#define NT_386_IOPERM 0x201
397#define NT_X86_XSTATE 0x202
398/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
399#define NT_S390_HIGH_GPRS 0x300
400#define NT_S390_TIMER 0x301
401#define NT_S390_TODCMP 0x302
402#define NT_S390_TODPREG 0x303
403/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
404#define NT_S390_CTRS 0x304
405#define NT_S390_PREFIX 0x305
406#define NT_S390_LAST_BREAK 0x306
407#define NT_S390_SYSTEM_CALL 0x307
408/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
409#define NT_S390_TDB 0x308
410#define NT_S390_VXRS_LOW 0x309
411#define NT_S390_VXRS_HIGH 0x30a
412#define NT_ARM_VFP 0x400
413/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
414#define NT_ARM_TLS 0x401
415#define NT_ARM_HW_BREAK 0x402
416#define NT_ARM_HW_WATCH 0x403
417#define NT_ARM_SYSTEM_CALL 0x404
418/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
419#define NT_METAG_CBUF 0x500
420#define NT_METAG_RPIPE 0x501
421#define NT_METAG_TLS 0x502
422typedef struct elf32_note {
423/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
424  Elf32_Word n_namesz;
425  Elf32_Word n_descsz;
426  Elf32_Word n_type;
427} Elf32_Nhdr;
428/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
429typedef struct elf64_note {
430  Elf64_Word n_namesz;
431  Elf64_Word n_descsz;
432  Elf64_Word n_type;
433/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
434} Elf64_Nhdr;
435#endif
436