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