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_MASKPROC 0xf0000000 302#define SHN_UNDEF 0 303/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ 304#define SHN_LORESERVE 0xff00 305#define SHN_LOPROC 0xff00 306#define SHN_HIPROC 0xff1f 307#define SHN_ABS 0xfff1 308/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ 309#define SHN_COMMON 0xfff2 310#define SHN_HIRESERVE 0xffff 311typedef struct elf32_shdr { 312 Elf32_Word sh_name; 313/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ 314 Elf32_Word sh_type; 315 Elf32_Word sh_flags; 316 Elf32_Addr sh_addr; 317 Elf32_Off sh_offset; 318/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ 319 Elf32_Word sh_size; 320 Elf32_Word sh_link; 321 Elf32_Word sh_info; 322 Elf32_Word sh_addralign; 323/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ 324 Elf32_Word sh_entsize; 325} Elf32_Shdr; 326typedef struct elf64_shdr { 327 Elf64_Word sh_name; 328/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ 329 Elf64_Word sh_type; 330 Elf64_Xword sh_flags; 331 Elf64_Addr sh_addr; 332 Elf64_Off sh_offset; 333/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ 334 Elf64_Xword sh_size; 335 Elf64_Word sh_link; 336 Elf64_Word sh_info; 337 Elf64_Xword sh_addralign; 338/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ 339 Elf64_Xword sh_entsize; 340} Elf64_Shdr; 341#define EI_MAG0 0 342#define EI_MAG1 1 343/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ 344#define EI_MAG2 2 345#define EI_MAG3 3 346#define EI_CLASS 4 347#define EI_DATA 5 348/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ 349#define EI_VERSION 6 350#define EI_OSABI 7 351#define EI_PAD 8 352#define ELFMAG0 0x7f 353/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ 354#define ELFMAG1 'E' 355#define ELFMAG2 'L' 356#define ELFMAG3 'F' 357#define ELFMAG "\177ELF" 358/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ 359#define SELFMAG 4 360#define ELFCLASSNONE 0 361#define ELFCLASS32 1 362#define ELFCLASS64 2 363/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ 364#define ELFCLASSNUM 3 365#define ELFDATANONE 0 366#define ELFDATA2LSB 1 367#define ELFDATA2MSB 2 368/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ 369#define EV_NONE 0 370#define EV_CURRENT 1 371#define EV_NUM 2 372#define ELFOSABI_NONE 0 373/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ 374#define ELFOSABI_LINUX 3 375#ifndef ELF_OSABI 376#define ELF_OSABI ELFOSABI_NONE 377#endif 378/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ 379#define NT_PRSTATUS 1 380#define NT_PRFPREG 2 381#define NT_PRPSINFO 3 382#define NT_TASKSTRUCT 4 383/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ 384#define NT_AUXV 6 385#define NT_SIGINFO 0x53494749 386#define NT_FILE 0x46494c45 387#define NT_PRXFPREG 0x46e62b7f 388/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ 389#define NT_PPC_VMX 0x100 390#define NT_PPC_SPE 0x101 391#define NT_PPC_VSX 0x102 392#define NT_386_TLS 0x200 393/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ 394#define NT_386_IOPERM 0x201 395#define NT_X86_XSTATE 0x202 396#define NT_S390_HIGH_GPRS 0x300 397#define NT_S390_TIMER 0x301 398/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ 399#define NT_S390_TODCMP 0x302 400#define NT_S390_TODPREG 0x303 401#define NT_S390_CTRS 0x304 402#define NT_S390_PREFIX 0x305 403/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ 404#define NT_S390_LAST_BREAK 0x306 405#define NT_S390_SYSTEM_CALL 0x307 406#define NT_S390_TDB 0x308 407#define NT_ARM_VFP 0x400 408/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ 409#define NT_ARM_TLS 0x401 410#define NT_ARM_HW_BREAK 0x402 411#define NT_ARM_HW_WATCH 0x403 412#define NT_METAG_CBUF 0x500 413/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ 414#define NT_METAG_RPIPE 0x501 415#define NT_METAG_TLS 0x502 416typedef struct elf32_note { 417 Elf32_Word n_namesz; 418/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ 419 Elf32_Word n_descsz; 420 Elf32_Word n_type; 421} Elf32_Nhdr; 422typedef struct elf64_note { 423/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ 424 Elf64_Word n_namesz; 425 Elf64_Word n_descsz; 426 Elf64_Word n_type; 427} Elf64_Nhdr; 428/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ 429#endif 430