blob: d76bd7f1ad7ff9c6ec9aedd7008c8e0bcdd7b377 [file] [log] [blame]
rjw1f884582022-01-06 17:20:42 +08001/*
2 * Copyright (c) 2018 MediaTek Inc.
3 *
4 * Permission is hereby granted, free of charge, to any person obtaining
5 * a copy of this software and associated documentation files
6 * (the "Software"), to deal in the Software without restriction,
7 * including without limitation the rights to use, copy, modify, merge,
8 * publish, distribute, sublicense, and/or sell copies of the Software,
9 * and to permit persons to whom the Software is furnished to do so,
10 * subject to the following conditions:
11 *
12 * The above copyright notice and this permission notice shall be
13 * included in all copies or substantial portions of the Software.
14 *
15 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
16 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
17 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
18 * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
19 * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
20 * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
21 * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22 */
23
24/****************************************************************************
25 ****************************************************************************
26 ***
27 *** This header was automatically generated from a Linux kernel header
28 *** of the same name, to make information necessary for userspace to
29 *** call into the kernel available to libc. It contains only constants,
30 *** structures, and macros generated from the original header, and thus,
31 *** contains no copyrightable information.
32 ***
33 *** To edit the content of this header, modify the corresponding
34 *** source file (e.g. under external/kernel-headers/original/) then
35 *** run bionic/libc/kernel/tools/update_all.py
36 ***
37 *** Any manual change here will be lost the next time this script will
38 *** be run. You've been warned!
39 ***
40 ****************************************************************************
41 ****************************************************************************/
42#ifndef _UAPI_LINUX_ELF_H
43#define _UAPI_LINUX_ELF_H
44
45typedef short __s16;
46typedef int __s32;
47typedef long long __s64;
48typedef unsigned short __u16;
49typedef unsigned int __u32;
50typedef unsigned long long __u64;
51
52/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
53typedef __u32 Elf32_Addr;
54typedef __u16 Elf32_Half;
55typedef __u32 Elf32_Off;
56typedef __s32 Elf32_Sword;
57/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
58typedef __u32 Elf32_Word;
59typedef __u64 Elf64_Addr;
60typedef __u16 Elf64_Half;
61typedef __s16 Elf64_SHalf;
62/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
63typedef __u64 Elf64_Off;
64typedef __s32 Elf64_Sword;
65typedef __u32 Elf64_Word;
66typedef __u64 Elf64_Xword;
67/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
68typedef __s64 Elf64_Sxword;
69#define PT_NULL 0
70#define PT_LOAD 1
71#define PT_DYNAMIC 2
72/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
73#define PT_INTERP 3
74#define PT_NOTE 4
75#define PT_SHLIB 5
76#define PT_PHDR 6
77/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
78#define PT_TLS 7
79
80/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
81#define ET_NONE 0
82#define ET_REL 1
83#define ET_EXEC 2
84#define ET_DYN 3
85/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
86#define ET_CORE 4
87#define ET_LOPROC 0xff00
88#define ET_HIPROC 0xffff
89/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
90
91
92#define EI_NIDENT 16
93
94typedef struct elf32_hdr {
95 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
96 unsigned char e_ident[EI_NIDENT];
97 Elf32_Half e_type;
98 Elf32_Half e_machine;
99 Elf32_Word e_version;
100 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
101 Elf32_Addr e_entry;
102 Elf32_Off e_phoff;
103 Elf32_Off e_shoff;
104 Elf32_Word e_flags;
105 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
106 Elf32_Half e_ehsize;
107 Elf32_Half e_phentsize;
108 Elf32_Half e_phnum;
109 Elf32_Half e_shentsize;
110 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
111 Elf32_Half e_shnum;
112 Elf32_Half e_shstrndx;
113} Elf32_Ehdr;
114typedef struct elf64_hdr {
115 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
116 unsigned char e_ident[EI_NIDENT];
117 Elf64_Half e_type;
118 Elf64_Half e_machine;
119 Elf64_Word e_version;
120 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
121 Elf64_Addr e_entry;
122 Elf64_Off e_phoff;
123 Elf64_Off e_shoff;
124 Elf64_Word e_flags;
125 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
126 Elf64_Half e_ehsize;
127 Elf64_Half e_phentsize;
128 Elf64_Half e_phnum;
129 Elf64_Half e_shentsize;
130 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
131 Elf64_Half e_shnum;
132 Elf64_Half e_shstrndx;
133} Elf64_Ehdr;
134#define PF_R 0x4
135/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
136#define PF_W 0x2
137#define PF_X 0x1
138typedef struct elf32_phdr {
139 Elf32_Word p_type;
140 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
141 Elf32_Off p_offset;
142 Elf32_Addr p_vaddr;
143 Elf32_Addr p_paddr;
144 Elf32_Word p_filesz;
145 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
146 Elf32_Word p_memsz;
147 Elf32_Word p_flags;
148 Elf32_Word p_align;
149} Elf32_Phdr;
150/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
151typedef struct elf64_phdr {
152 Elf64_Word p_type;
153 Elf64_Word p_flags;
154 Elf64_Off p_offset;
155 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
156 Elf64_Addr p_vaddr;
157 Elf64_Addr p_paddr;
158 Elf64_Xword p_filesz;
159 Elf64_Xword p_memsz;
160 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
161 Elf64_Xword p_align;
162} Elf64_Phdr;
163
164#define EI_MAG0 0
165#define EI_MAG1 1
166/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
167#define EI_MAG2 2
168#define EI_MAG3 3
169#define EI_CLASS 4
170#define EI_DATA 5
171/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
172#define EI_VERSION 6
173#define EI_OSABI 7
174#define EI_PAD 8
175#define ELFMAG0 0x7f
176/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
177#define ELFMAG1 'E'
178#define ELFMAG2 'L'
179#define ELFMAG3 'F'
180#define ELFMAG "\177ELF"
181/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
182#define SELFMAG 4
183#define ELFCLASSNONE 0
184#define ELFCLASS32 1
185#define ELFCLASS64 2
186/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
187#define ELFCLASSNUM 3
188#define ELFDATANONE 0
189#define ELFDATA2LSB 1
190#define ELFDATA2MSB 2
191/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
192#define EV_NONE 0
193#define EV_CURRENT 1
194#define EV_NUM 2
195#define ELFOSABI_NONE 0
196/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
197#define ELFOSABI_LINUX 3
198#ifndef ELF_OSABI
199#define ELF_OSABI ELFOSABI_NONE
200#endif
201
202#define NT_PRSTATUS 1
203#define NT_PRFPREG 2
204#define NT_PRPSINFO 3
205#define NT_TASKSTRUCT 4
206/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
207#define NT_AUXV 6
208
209/* Note header in a PT_NOTE section */
210typedef struct elf32_note {
211 Elf32_Word n_namesz;
212 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
213 Elf32_Word n_descsz;
214 Elf32_Word n_type;
215} Elf32_Nhdr;
216typedef struct elf64_note {
217 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
218 Elf64_Word n_namesz;
219 Elf64_Word n_descsz;
220 Elf64_Word n_type;
221} Elf64_Nhdr;
222/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
223#define EM_AARCH64 183
224#define EM_ARM 40
225#endif