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#define E_SYMNMLEN 8 20#define E_FILNMLEN 14 21#define E_DIMNUM 4 22#define COFF_SHORT_L(ps) ((short) (((unsigned short) ((unsigned char) ps[1]) << 8) | ((unsigned short) ((unsigned char) ps[0])))) 23#define COFF_LONG_L(ps) (((long) (((unsigned long) ((unsigned char) ps[3]) << 24) | ((unsigned long) ((unsigned char) ps[2]) << 16) | ((unsigned long) ((unsigned char) ps[1]) << 8) | ((unsigned long) ((unsigned char) ps[0]))))) 24#define COFF_SHORT_H(ps) ((short) (((unsigned short) ((unsigned char) ps[0]) << 8) | ((unsigned short) ((unsigned char) ps[1])))) 25#define COFF_LONG_H(ps) (((long) (((unsigned long) ((unsigned char) ps[0]) << 24) | ((unsigned long) ((unsigned char) ps[1]) << 16) | ((unsigned long) ((unsigned char) ps[2]) << 8) | ((unsigned long) ((unsigned char) ps[3]))))) 26#define COFF_LONG(v) COFF_LONG_L(v) 27#define COFF_SHORT(v) COFF_SHORT_L(v) 28struct COFF_filehdr { 29 char f_magic[2]; 30 char f_nscns[2]; 31 char f_timdat[4]; 32 char f_symptr[4]; 33 char f_nsyms[4]; 34 char f_opthdr[2]; 35 char f_flags[2]; 36}; 37#define COFF_F_RELFLG 0000001 38#define COFF_F_EXEC 0000002 39#define COFF_F_LNNO 0000004 40#define COFF_F_LSYMS 0000010 41#define COFF_F_MINMAL 0000020 42#define COFF_F_UPDATE 0000040 43#define COFF_F_SWABD 0000100 44#define COFF_F_AR16WR 0000200 45#define COFF_F_AR32WR 0000400 46#define COFF_F_AR32W 0001000 47#define COFF_F_PATCH 0002000 48#define COFF_F_NODF 0002000 49#define COFF_I386MAGIC 0x14c 50#define COFF_I386BADMAG(x) (COFF_SHORT((x).f_magic) != COFF_I386MAGIC) 51#define COFF_FILHDR struct COFF_filehdr 52#define COFF_FILHSZ sizeof(COFF_FILHDR) 53typedef struct { 54 char magic[2]; 55 char vstamp[2]; 56 char tsize[4]; 57 char dsize[4]; 58 char bsize[4]; 59 char entry[4]; 60 char text_start[4]; 61 char data_start[4]; 62} COFF_AOUTHDR; 63#define COFF_AOUTSZ (sizeof(COFF_AOUTHDR)) 64#define COFF_STMAGIC 0401 65#define COFF_OMAGIC 0404 66#define COFF_JMAGIC 0407 67#define COFF_DMAGIC 0410 68#define COFF_ZMAGIC 0413 69#define COFF_SHMAGIC 0443 70struct COFF_scnhdr { 71 char s_name[8]; 72 char s_paddr[4]; 73 char s_vaddr[4]; 74 char s_size[4]; 75 char s_scnptr[4]; 76 char s_relptr[4]; 77 char s_lnnoptr[4]; 78 char s_nreloc[2]; 79 char s_nlnno[2]; 80 char s_flags[4]; 81}; 82#define COFF_SCNHDR struct COFF_scnhdr 83#define COFF_SCNHSZ sizeof(COFF_SCNHDR) 84#define COFF_TEXT ".text" 85#define COFF_DATA ".data" 86#define COFF_BSS ".bss" 87#define COFF_COMMENT ".comment" 88#define COFF_LIB ".lib" 89#define COFF_SECT_TEXT 0 90#define COFF_SECT_DATA 1 91#define COFF_SECT_BSS 2 92#define COFF_SECT_REQD 3 93#define COFF_STYP_REG 0x00 94#define COFF_STYP_DSECT 0x01 95#define COFF_STYP_NOLOAD 0x02 96#define COFF_STYP_GROUP 0x04 97#define COFF_STYP_PAD 0x08 98#define COFF_STYP_COPY 0x10 99#define COFF_STYP_TEXT 0x20 100#define COFF_STYP_DATA 0x40 101#define COFF_STYP_BSS 0x80 102#define COFF_STYP_INFO 0x200 103#define COFF_STYP_OVER 0x400 104#define COFF_STYP_LIB 0x800 105struct COFF_slib { 106 char sl_entsz[4]; 107 char sl_pathndx[4]; 108}; 109#define COFF_SLIBHD struct COFF_slib 110#define COFF_SLIBSZ sizeof(COFF_SLIBHD) 111struct COFF_lineno { 112 union { 113 char l_symndx[4]; 114 char l_paddr[4]; 115 } l_addr; 116 char l_lnno[2]; 117}; 118#define COFF_LINENO struct COFF_lineno 119#define COFF_LINESZ 6 120#define COFF_E_SYMNMLEN 8 121#define COFF_E_FILNMLEN 14 122#define COFF_E_DIMNUM 4 123struct COFF_syment { 124 union { 125 char e_name[E_SYMNMLEN]; 126 struct { 127 char e_zeroes[4]; 128 char e_offset[4]; 129 } e; 130 } e; 131 char e_value[4]; 132 char e_scnum[2]; 133 char e_type[2]; 134 char e_sclass[1]; 135 char e_numaux[1]; 136}; 137#define COFF_N_BTMASK (0xf) 138#define COFF_N_TMASK (0x30) 139#define COFF_N_BTSHFT (4) 140#define COFF_N_TSHIFT (2) 141union COFF_auxent { 142 struct { 143 char x_tagndx[4]; 144 union { 145 struct { 146 char x_lnno[2]; 147 char x_size[2]; 148 } x_lnsz; 149 char x_fsize[4]; 150 } x_misc; 151 union { 152 struct { 153 char x_lnnoptr[4]; 154 char x_endndx[4]; 155 } x_fcn; 156 struct { 157 char x_dimen[E_DIMNUM][2]; 158 } x_ary; 159 } x_fcnary; 160 char x_tvndx[2]; 161 } x_sym; 162 union { 163 char x_fname[E_FILNMLEN]; 164 struct { 165 char x_zeroes[4]; 166 char x_offset[4]; 167 } x_n; 168 } x_file; 169 struct { 170 char x_scnlen[4]; 171 char x_nreloc[2]; 172 char x_nlinno[2]; 173 } x_scn; 174 struct { 175 char x_tvfill[4]; 176 char x_tvlen[2]; 177 char x_tvran[2][2]; 178 } x_tv; 179}; 180#define COFF_SYMENT struct COFF_syment 181#define COFF_SYMESZ 18 182#define COFF_AUXENT union COFF_auxent 183#define COFF_AUXESZ 18 184#define COFF_ETEXT "etext" 185struct COFF_reloc { 186 char r_vaddr[4]; 187 char r_symndx[4]; 188 char r_type[2]; 189}; 190#define COFF_RELOC struct COFF_reloc 191#define COFF_RELSZ 10 192#define COFF_DEF_DATA_SECTION_ALIGNMENT 4 193#define COFF_DEF_BSS_SECTION_ALIGNMENT 4 194#define COFF_DEF_TEXT_SECTION_ALIGNMENT 4 195#define COFF_DEF_SECTION_ALIGNMENT 4 196