Home | History | Annotate | Download | only in linux
      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 _LINUX_ELF_H
     20 #define _LINUX_ELF_H
     21 #include <linux/types.h>
     22 #include <linux/auxvec.h>
     23 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
     24 #include <linux/elf-em.h>
     25 #include <asm/elf.h>
     26 #ifndef elf_read_implies_exec
     27 #define elf_read_implies_exec(ex, have_pt_gnu_stack) 0
     28 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
     29 #endif
     30 typedef __u32 Elf32_Addr;
     31 typedef __u16 Elf32_Half;
     32 typedef __u32 Elf32_Off;
     33 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
     34 typedef __s32 Elf32_Sword;
     35 typedef __u32 Elf32_Word;
     36 typedef __u64 Elf64_Addr;
     37 typedef __u16 Elf64_Half;
     38 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
     39 typedef __s16 Elf64_SHalf;
     40 typedef __u64 Elf64_Off;
     41 typedef __s32 Elf64_Sword;
     42 typedef __u32 Elf64_Word;
     43 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
     44 typedef __u64 Elf64_Xword;
     45 typedef __s64 Elf64_Sxword;
     46 #define PT_NULL 0
     47 #define PT_LOAD 1
     48 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
     49 #define PT_DYNAMIC 2
     50 #define PT_INTERP 3
     51 #define PT_NOTE 4
     52 #define PT_SHLIB 5
     53 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
     54 #define PT_PHDR 6
     55 #define PT_TLS 7
     56 #define PT_LOOS 0x60000000
     57 #define PT_HIOS 0x6fffffff
     58 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
     59 #define PT_LOPROC 0x70000000
     60 #define PT_HIPROC 0x7fffffff
     61 #define PT_GNU_EH_FRAME 0x6474e550
     62 #define PT_GNU_STACK (PT_LOOS + 0x474e551)
     63 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
     64 #define ET_NONE 0
     65 #define ET_REL 1
     66 #define ET_EXEC 2
     67 #define ET_DYN 3
     68 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
     69 #define ET_CORE 4
     70 #define ET_LOPROC 0xff00
     71 #define ET_HIPROC 0xffff
     72 #define DT_NULL 0
     73 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
     74 #define DT_NEEDED 1
     75 #define DT_PLTRELSZ 2
     76 #define DT_PLTGOT 3
     77 #define DT_HASH 4
     78 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
     79 #define DT_STRTAB 5
     80 #define DT_SYMTAB 6
     81 #define DT_RELA 7
     82 #define DT_RELASZ 8
     83 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
     84 #define DT_RELAENT 9
     85 #define DT_STRSZ 10
     86 #define DT_SYMENT 11
     87 #define DT_INIT 12
     88 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
     89 #define DT_FINI 13
     90 #define DT_SONAME 14
     91 #define DT_RPATH 15
     92 #define DT_SYMBOLIC 16
     93 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
     94 #define DT_REL 17
     95 #define DT_RELSZ 18
     96 #define DT_RELENT 19
     97 #define DT_PLTREL 20
     98 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
     99 #define DT_DEBUG 21
    100 #define DT_TEXTREL 22
    101 #define DT_JMPREL 23
    102 #define DT_LOPROC 0x70000000
    103 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
    104 #define DT_HIPROC 0x7fffffff
    105 #define STB_LOCAL 0
    106 #define STB_GLOBAL 1
    107 #define STB_WEAK 2
    108 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
    109 #define STT_NOTYPE 0
    110 #define STT_OBJECT 1
    111 #define STT_FUNC 2
    112 #define STT_SECTION 3
    113 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
    114 #define STT_FILE 4
    115 #define STT_COMMON 5
    116 #define STT_TLS 6
    117 #define ELF_ST_BIND(x) ((x) >> 4)
    118 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
    119 #define ELF_ST_TYPE(x) (((unsigned int) x) & 0xf)
    120 #define ELF32_ST_BIND(x) ELF_ST_BIND(x)
    121 #define ELF32_ST_TYPE(x) ELF_ST_TYPE(x)
    122 #define ELF64_ST_BIND(x) ELF_ST_BIND(x)
    123 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
    124 #define ELF64_ST_TYPE(x) ELF_ST_TYPE(x)
    125 typedef struct dynamic{
    126  Elf32_Sword d_tag;
    127  union{
    128 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
    129  Elf32_Sword d_val;
    130  Elf32_Addr d_ptr;
    131  } d_un;
    132 } Elf32_Dyn;
    133 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
    134 typedef struct {
    135  Elf64_Sxword d_tag;
    136  union {
    137  Elf64_Xword d_val;
    138 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
    139  Elf64_Addr d_ptr;
    140  } d_un;
    141 } Elf64_Dyn;
    142 #define ELF32_R_SYM(x) ((x) >> 8)
    143 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
    144 #define ELF32_R_TYPE(x) ((x) & 0xff)
    145 #define ELF64_R_SYM(i) ((i) >> 32)
    146 #define ELF64_R_TYPE(i) ((i) & 0xffffffff)
    147 typedef struct elf32_rel {
    148 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
    149  Elf32_Addr r_offset;
    150  Elf32_Word r_info;
    151 } Elf32_Rel;
    152 typedef struct elf64_rel {
    153 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
    154  Elf64_Addr r_offset;
    155  Elf64_Xword r_info;
    156 } Elf64_Rel;
    157 typedef struct elf32_rela{
    158 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
    159  Elf32_Addr r_offset;
    160  Elf32_Word r_info;
    161  Elf32_Sword r_addend;
    162 } Elf32_Rela;
    163 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
    164 typedef struct elf64_rela {
    165  Elf64_Addr r_offset;
    166  Elf64_Xword r_info;
    167  Elf64_Sxword r_addend;
    168 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
    169 } Elf64_Rela;
    170 typedef struct elf32_sym{
    171  Elf32_Word st_name;
    172  Elf32_Addr st_value;
    173 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
    174  Elf32_Word st_size;
    175  unsigned char st_info;
    176  unsigned char st_other;
    177  Elf32_Half st_shndx;
    178 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
    179 } Elf32_Sym;
    180 typedef struct elf64_sym {
    181  Elf64_Word st_name;
    182  unsigned char st_info;
    183 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
    184  unsigned char st_other;
    185  Elf64_Half st_shndx;
    186  Elf64_Addr st_value;
    187  Elf64_Xword st_size;
    188 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
    189 } Elf64_Sym;
    190 #define EI_NIDENT 16
    191 typedef struct elf32_hdr{
    192  unsigned char e_ident[EI_NIDENT];
    193 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
    194  Elf32_Half e_type;
    195  Elf32_Half e_machine;
    196  Elf32_Word e_version;
    197  Elf32_Addr e_entry;
    198 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
    199  Elf32_Off e_phoff;
    200  Elf32_Off e_shoff;
    201  Elf32_Word e_flags;
    202  Elf32_Half e_ehsize;
    203 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
    204  Elf32_Half e_phentsize;
    205  Elf32_Half e_phnum;
    206  Elf32_Half e_shentsize;
    207  Elf32_Half e_shnum;
    208 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
    209  Elf32_Half e_shstrndx;
    210 } Elf32_Ehdr;
    211 typedef struct elf64_hdr {
    212  unsigned char e_ident[16];
    213 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
    214  Elf64_Half e_type;
    215  Elf64_Half e_machine;
    216  Elf64_Word e_version;
    217  Elf64_Addr e_entry;
    218 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
    219  Elf64_Off e_phoff;
    220  Elf64_Off e_shoff;
    221  Elf64_Word e_flags;
    222  Elf64_Half e_ehsize;
    223 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
    224  Elf64_Half e_phentsize;
    225  Elf64_Half e_phnum;
    226  Elf64_Half e_shentsize;
    227  Elf64_Half e_shnum;
    228 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
    229  Elf64_Half e_shstrndx;
    230 } Elf64_Ehdr;
    231 #define PF_R 0x4
    232 #define PF_W 0x2
    233 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
    234 #define PF_X 0x1
    235 typedef struct elf32_phdr{
    236  Elf32_Word p_type;
    237  Elf32_Off p_offset;
    238 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
    239  Elf32_Addr p_vaddr;
    240  Elf32_Addr p_paddr;
    241  Elf32_Word p_filesz;
    242  Elf32_Word p_memsz;
    243 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
    244  Elf32_Word p_flags;
    245  Elf32_Word p_align;
    246 } Elf32_Phdr;
    247 typedef struct elf64_phdr {
    248 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
    249  Elf64_Word p_type;
    250  Elf64_Word p_flags;
    251  Elf64_Off p_offset;
    252  Elf64_Addr p_vaddr;
    253 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
    254  Elf64_Addr p_paddr;
    255  Elf64_Xword p_filesz;
    256  Elf64_Xword p_memsz;
    257  Elf64_Xword p_align;
    258 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
    259 } Elf64_Phdr;
    260 #define SHT_NULL 0
    261 #define SHT_PROGBITS 1
    262 #define SHT_SYMTAB 2
    263 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
    264 #define SHT_STRTAB 3
    265 #define SHT_RELA 4
    266 #define SHT_HASH 5
    267 #define SHT_DYNAMIC 6
    268 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
    269 #define SHT_NOTE 7
    270 #define SHT_NOBITS 8
    271 #define SHT_REL 9
    272 #define SHT_SHLIB 10
    273 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
    274 #define SHT_DYNSYM 11
    275 #define SHT_NUM 12
    276 #define SHT_LOPROC 0x70000000
    277 #define SHT_HIPROC 0x7fffffff
    278 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
    279 #define SHT_LOUSER 0x80000000
    280 #define SHT_HIUSER 0xffffffff
    281 #define SHF_WRITE 0x1
    282 #define SHF_ALLOC 0x2
    283 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
    284 #define SHF_EXECINSTR 0x4
    285 #define SHF_MASKPROC 0xf0000000
    286 #define SHN_UNDEF 0
    287 #define SHN_LORESERVE 0xff00
    288 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
    289 #define SHN_LOPROC 0xff00
    290 #define SHN_HIPROC 0xff1f
    291 #define SHN_ABS 0xfff1
    292 #define SHN_COMMON 0xfff2
    293 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
    294 #define SHN_HIRESERVE 0xffff
    295 typedef struct {
    296  Elf32_Word sh_name;
    297  Elf32_Word sh_type;
    298 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
    299  Elf32_Word sh_flags;
    300  Elf32_Addr sh_addr;
    301  Elf32_Off sh_offset;
    302  Elf32_Word sh_size;
    303 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
    304  Elf32_Word sh_link;
    305  Elf32_Word sh_info;
    306  Elf32_Word sh_addralign;
    307  Elf32_Word sh_entsize;
    308 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
    309 } Elf32_Shdr;
    310 typedef struct elf64_shdr {
    311  Elf64_Word sh_name;
    312  Elf64_Word sh_type;
    313 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
    314  Elf64_Xword sh_flags;
    315  Elf64_Addr sh_addr;
    316  Elf64_Off sh_offset;
    317  Elf64_Xword sh_size;
    318 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
    319  Elf64_Word sh_link;
    320  Elf64_Word sh_info;
    321  Elf64_Xword sh_addralign;
    322  Elf64_Xword sh_entsize;
    323 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
    324 } Elf64_Shdr;
    325 #define EI_MAG0 0
    326 #define EI_MAG1 1
    327 #define EI_MAG2 2
    328 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
    329 #define EI_MAG3 3
    330 #define EI_CLASS 4
    331 #define EI_DATA 5
    332 #define EI_VERSION 6
    333 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
    334 #define EI_OSABI 7
    335 #define EI_PAD 8
    336 #define ELFMAG0 0x7f
    337 #define ELFMAG1 'E'
    338 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
    339 #define ELFMAG2 'L'
    340 #define ELFMAG3 'F'
    341 #define ELFMAG "\177ELF"
    342 #define SELFMAG 4
    343 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
    344 #define ELFCLASSNONE 0
    345 #define ELFCLASS32 1
    346 #define ELFCLASS64 2
    347 #define ELFCLASSNUM 3
    348 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
    349 #define ELFDATANONE 0
    350 #define ELFDATA2LSB 1
    351 #define ELFDATA2MSB 2
    352 #define EV_NONE 0
    353 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
    354 #define EV_CURRENT 1
    355 #define EV_NUM 2
    356 #define ELFOSABI_NONE 0
    357 #define ELFOSABI_LINUX 3
    358 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
    359 #ifndef ELF_OSABI
    360 #define ELF_OSABI ELFOSABI_NONE
    361 #endif
    362 #define NT_PRSTATUS 1
    363 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
    364 #define NT_PRFPREG 2
    365 #define NT_PRPSINFO 3
    366 #define NT_TASKSTRUCT 4
    367 #define NT_AUXV 6
    368 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
    369 #define NT_PRXFPREG 0x46e62b7f
    370 typedef struct elf32_note {
    371  Elf32_Word n_namesz;
    372  Elf32_Word n_descsz;
    373 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
    374  Elf32_Word n_type;
    375 } Elf32_Nhdr;
    376 typedef struct elf64_note {
    377  Elf64_Word n_namesz;
    378 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
    379  Elf64_Word n_descsz;
    380  Elf64_Word n_type;
    381 } Elf64_Nhdr;
    382 #if ELF_CLASS == ELFCLASS32
    383 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
    384 #define elfhdr elf32_hdr
    385 #define elf_phdr elf32_phdr
    386 #define elf_note elf32_note
    387 #else
    388 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
    389 #define elfhdr elf64_hdr
    390 #define elf_phdr elf64_phdr
    391 #define elf_note elf64_note
    392 #endif
    393 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
    394 #endif
    395