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