~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/include/uapi/linux/coff.h

Version: ~ [ linux-6.11-rc3 ] ~ [ linux-6.10.4 ] ~ [ linux-6.9.12 ] ~ [ linux-6.8.12 ] ~ [ linux-6.7.12 ] ~ [ linux-6.6.45 ] ~ [ linux-6.5.13 ] ~ [ linux-6.4.16 ] ~ [ linux-6.3.13 ] ~ [ linux-6.2.16 ] ~ [ linux-6.1.104 ] ~ [ linux-6.0.19 ] ~ [ linux-5.19.17 ] ~ [ linux-5.18.19 ] ~ [ linux-5.17.15 ] ~ [ linux-5.16.20 ] ~ [ linux-5.15.164 ] ~ [ linux-5.14.21 ] ~ [ linux-5.13.19 ] ~ [ linux-5.12.19 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.223 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.281 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.319 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.336 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.337 ] ~ [ linux-4.4.302 ] ~ [ linux-3.10.108 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.9 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

Diff markup

Differences between /include/uapi/linux/coff.h (Version linux-6.11-rc3) and /include/uapi/linux/coff.h (Version linux-4.14.336)


  1 /* SPDX-License-Identifier: GPL-2.0 WITH Linux      1 /* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
  2 /* This file is derived from the GAS 2.1.4 ass      2 /* This file is derived from the GAS 2.1.4 assembler control file.
  3    The GAS product is under the GNU General Pu      3    The GAS product is under the GNU General Public License, version 2 or later.
  4    As such, this file is also under that licen      4    As such, this file is also under that license.
  5                                                     5 
  6    If the file format changes in the COFF obje      6    If the file format changes in the COFF object, this file should be
  7    subsequently updated to reflect the changes      7    subsequently updated to reflect the changes.
  8                                                     8 
  9    The actual loader module only uses a few of      9    The actual loader module only uses a few of these structures. The full
 10    set is documented here because I received t     10    set is documented here because I received the full set. If you wish
 11    more information about COFF, then O'Reilly      11    more information about COFF, then O'Reilly has a very excellent book.
 12 */                                                 12 */
 13                                                    13 
 14 #ifndef _UAPI_LINUX_COFF_H                     << 
 15 #define _UAPI_LINUX_COFF_H                     << 
 16                                                << 
 17 #define  E_SYMNMLEN  8   /* Number of characte     14 #define  E_SYMNMLEN  8   /* Number of characters in a symbol name         */
 18 #define  E_FILNMLEN 14   /* Number of characte     15 #define  E_FILNMLEN 14   /* Number of characters in a file name           */
 19 #define  E_DIMNUM    4   /* Number of array di     16 #define  E_DIMNUM    4   /* Number of array dimensions in auxiliary entry */
 20                                                    17 
 21 /*                                                 18 /*
 22  * These defines are byte order independent. T     19  * These defines are byte order independent. There is no alignment of fields
 23  * permitted in the structures. Therefore they     20  * permitted in the structures. Therefore they are declared as characters
 24  * and the values loaded from the character po     21  * and the values loaded from the character positions. It also makes it
 25  * nice to have it "endian" independent.           22  * nice to have it "endian" independent.
 26  */                                                23  */
 27                                                    24  
 28 /* Load a short int from the following tables      25 /* Load a short int from the following tables with little-endian formats */
 29 #define COFF_SHORT_L(ps) ((short)(((unsigned s     26 #define COFF_SHORT_L(ps) ((short)(((unsigned short)((unsigned char)ps[1])<<8)|\
 30                                   ((unsigned s     27                                   ((unsigned short)((unsigned char)ps[0]))))
 31                                                    28 
 32 /* Load a long int from the following tables w     29 /* Load a long int from the following tables with little-endian formats */
 33 #define COFF_LONG_L(ps) (((long)(((unsigned lo     30 #define COFF_LONG_L(ps) (((long)(((unsigned long)((unsigned char)ps[3])<<24) |\
 34                                  ((unsigned lo     31                                  ((unsigned long)((unsigned char)ps[2])<<16) |\
 35                                  ((unsigned lo     32                                  ((unsigned long)((unsigned char)ps[1])<<8)  |\
 36                                  ((unsigned lo     33                                  ((unsigned long)((unsigned char)ps[0])))))
 37                                                    34  
 38 /* Load a short int from the following tables      35 /* Load a short int from the following tables with big-endian formats */
 39 #define COFF_SHORT_H(ps) ((short)(((unsigned s     36 #define COFF_SHORT_H(ps) ((short)(((unsigned short)((unsigned char)ps[0])<<8)|\
 40                                   ((unsigned s     37                                   ((unsigned short)((unsigned char)ps[1]))))
 41                                                    38 
 42 /* Load a long int from the following tables w     39 /* Load a long int from the following tables with big-endian formats */
 43 #define COFF_LONG_H(ps) (((long)(((unsigned lo     40 #define COFF_LONG_H(ps) (((long)(((unsigned long)((unsigned char)ps[0])<<24) |\
 44                                  ((unsigned lo     41                                  ((unsigned long)((unsigned char)ps[1])<<16) |\
 45                                  ((unsigned lo     42                                  ((unsigned long)((unsigned char)ps[2])<<8)  |\
 46                                  ((unsigned lo     43                                  ((unsigned long)((unsigned char)ps[3])))))
 47                                                    44 
 48 /* These may be overridden later by brain dead     45 /* These may be overridden later by brain dead implementations which generate
 49    a big-endian header with little-endian data     46    a big-endian header with little-endian data. In that case, generate a
 50    replacement macro which tests a flag and us     47    replacement macro which tests a flag and uses either of the two above
 51    as appropriate. */                              48    as appropriate. */
 52                                                    49 
 53 #define COFF_LONG(v)   COFF_LONG_L(v)              50 #define COFF_LONG(v)   COFF_LONG_L(v)
 54 #define COFF_SHORT(v)  COFF_SHORT_L(v)             51 #define COFF_SHORT(v)  COFF_SHORT_L(v)
 55                                                    52 
 56 /*** coff information for Intel 386/486.  */       53 /*** coff information for Intel 386/486.  */
 57                                                    54 
 58 /********************** FILE HEADER **********     55 /********************** FILE HEADER **********************/
 59                                                    56 
 60 struct COFF_filehdr {                              57 struct COFF_filehdr {
 61         char f_magic[2];        /* magic numbe     58         char f_magic[2];        /* magic number                 */
 62         char f_nscns[2];        /* number of s     59         char f_nscns[2];        /* number of sections           */
 63         char f_timdat[4];       /* time & date     60         char f_timdat[4];       /* time & date stamp            */
 64         char f_symptr[4];       /* file pointe     61         char f_symptr[4];       /* file pointer to symtab       */
 65         char f_nsyms[4];        /* number of s     62         char f_nsyms[4];        /* number of symtab entries     */
 66         char f_opthdr[2];       /* sizeof(opti     63         char f_opthdr[2];       /* sizeof(optional hdr)         */
 67         char f_flags[2];        /* flags           64         char f_flags[2];        /* flags                        */
 68 };                                                 65 };
 69                                                    66 
 70 /*                                                 67 /*
 71  *   Bits for f_flags:                             68  *   Bits for f_flags:
 72  *                                                 69  *
 73  *      F_RELFLG        relocation info stripp     70  *      F_RELFLG        relocation info stripped from file
 74  *      F_EXEC          file is executable  (i     71  *      F_EXEC          file is executable  (i.e. no unresolved external
 75  *                      references)                72  *                      references)
 76  *      F_LNNO          line numbers stripped      73  *      F_LNNO          line numbers stripped from file
 77  *      F_LSYMS         local symbols stripped     74  *      F_LSYMS         local symbols stripped from file
 78  *      F_MINMAL        this is a minimal obje     75  *      F_MINMAL        this is a minimal object file (".m") output of fextract
 79  *      F_UPDATE        this is a fully bound      76  *      F_UPDATE        this is a fully bound update file, output of ogen
 80  *      F_SWABD         this file has had its      77  *      F_SWABD         this file has had its bytes swabbed (in names)
 81  *      F_AR16WR        this file has the byte     78  *      F_AR16WR        this file has the byte ordering of an AR16WR
 82  *                      (e.g. 11/70) machine       79  *                      (e.g. 11/70) machine
 83  *      F_AR32WR        this file has the byte     80  *      F_AR32WR        this file has the byte ordering of an AR32WR machine
 84  *                      (e.g. vax and iNTEL 38     81  *                      (e.g. vax and iNTEL 386)
 85  *      F_AR32W         this file has the byte     82  *      F_AR32W         this file has the byte ordering of an AR32W machine
 86  *                      (e.g. 3b,maxi)             83  *                      (e.g. 3b,maxi)
 87  *      F_PATCH         file contains "patch"      84  *      F_PATCH         file contains "patch" list in optional header
 88  *      F_NODF          (minimal file only) no     85  *      F_NODF          (minimal file only) no decision functions for
 89  *                      replaced functions         86  *                      replaced functions
 90  */                                                87  */
 91                                                    88 
 92 #define  COFF_F_RELFLG          0000001            89 #define  COFF_F_RELFLG          0000001
 93 #define  COFF_F_EXEC            0000002            90 #define  COFF_F_EXEC            0000002
 94 #define  COFF_F_LNNO            0000004            91 #define  COFF_F_LNNO            0000004
 95 #define  COFF_F_LSYMS           0000010            92 #define  COFF_F_LSYMS           0000010
 96 #define  COFF_F_MINMAL          0000020            93 #define  COFF_F_MINMAL          0000020
 97 #define  COFF_F_UPDATE          0000040            94 #define  COFF_F_UPDATE          0000040
 98 #define  COFF_F_SWABD           0000100            95 #define  COFF_F_SWABD           0000100
 99 #define  COFF_F_AR16WR          0000200            96 #define  COFF_F_AR16WR          0000200
100 #define  COFF_F_AR32WR          0000400            97 #define  COFF_F_AR32WR          0000400
101 #define  COFF_F_AR32W           0001000            98 #define  COFF_F_AR32W           0001000
102 #define  COFF_F_PATCH           0002000            99 #define  COFF_F_PATCH           0002000
103 #define  COFF_F_NODF            0002000           100 #define  COFF_F_NODF            0002000
104                                                   101 
105 #define COFF_I386MAGIC          0x14c   /* Lin    102 #define COFF_I386MAGIC          0x14c   /* Linux's system    */
106                                                   103 
107 #if 0   /* Perhaps, someday, these formats may    104 #if 0   /* Perhaps, someday, these formats may be used.      */
108 #define COFF_I386PTXMAGIC       0x154             105 #define COFF_I386PTXMAGIC       0x154
109 #define COFF_I386AIXMAGIC       0x175   /* IBM    106 #define COFF_I386AIXMAGIC       0x175   /* IBM's AIX system  */
110 #define COFF_I386BADMAG(x) ((COFF_SHORT((x).f_    107 #define COFF_I386BADMAG(x) ((COFF_SHORT((x).f_magic) != COFF_I386MAGIC) \
111                           && COFF_SHORT((x).f_    108                           && COFF_SHORT((x).f_magic) != COFF_I386PTXMAGIC \
112                           && COFF_SHORT((x).f_    109                           && COFF_SHORT((x).f_magic) != COFF_I386AIXMAGIC)
113 #else                                             110 #else
114 #define COFF_I386BADMAG(x) (COFF_SHORT((x).f_m    111 #define COFF_I386BADMAG(x) (COFF_SHORT((x).f_magic) != COFF_I386MAGIC)
115 #endif                                            112 #endif
116                                                   113 
117 #define COFF_FILHDR     struct COFF_filehdr       114 #define COFF_FILHDR     struct COFF_filehdr
118 #define COFF_FILHSZ     sizeof(COFF_FILHDR)       115 #define COFF_FILHSZ     sizeof(COFF_FILHDR)
119                                                   116 
120 /********************** AOUT "OPTIONAL HEADER"    117 /********************** AOUT "OPTIONAL HEADER" **********************/
121                                                   118 
122 /* Linux COFF must have this "optional" header    119 /* Linux COFF must have this "optional" header. Standard COFF has no entry
123    location for the "entry" point. They normal    120    location for the "entry" point. They normally would start with the first
124    location of the .text section. This is not     121    location of the .text section. This is not a good idea for linux. So,
125    the use of this "optional" header is not op    122    the use of this "optional" header is not optional. It is required.
126                                                   123 
127    Do not be tempted to assume that the size o    124    Do not be tempted to assume that the size of the optional header is
128    a constant and simply index the next byte b    125    a constant and simply index the next byte by the size of this structure.
129    Use the 'f_opthdr' field in the main coff h    126    Use the 'f_opthdr' field in the main coff header for the size of the
130    structure actually written to the file!!       127    structure actually written to the file!!
131 */                                                128 */
132                                                   129 
133 typedef struct                                    130 typedef struct 
134 {                                                 131 {
135   char  magic[2];               /* type of fil    132   char  magic[2];               /* type of file                          */
136   char  vstamp[2];              /* version sta    133   char  vstamp[2];              /* version stamp                         */
137   char  tsize[4];               /* text size i    134   char  tsize[4];               /* text size in bytes, padded to FW bdry */
138   char  dsize[4];               /* initialized    135   char  dsize[4];               /* initialized   data "   "              */
139   char  bsize[4];               /* uninitializ    136   char  bsize[4];               /* uninitialized data "   "              */
140   char  entry[4];               /* entry pt.      137   char  entry[4];               /* entry pt.                             */
141   char  text_start[4];          /* base of tex    138   char  text_start[4];          /* base of text used for this file       */
142   char  data_start[4];          /* base of dat    139   char  data_start[4];          /* base of data used for this file       */
143 }                                                 140 }
144 COFF_AOUTHDR;                                     141 COFF_AOUTHDR;
145                                                   142 
146 #define COFF_AOUTSZ (sizeof(COFF_AOUTHDR))        143 #define COFF_AOUTSZ (sizeof(COFF_AOUTHDR))
147                                                   144 
148 #define COFF_STMAGIC    0401                      145 #define COFF_STMAGIC    0401
149 #define COFF_OMAGIC     0404                      146 #define COFF_OMAGIC     0404
150 #define COFF_JMAGIC     0407    /* dirty text     147 #define COFF_JMAGIC     0407    /* dirty text and data image, can't share  */
151 #define COFF_DMAGIC     0410    /* dirty text     148 #define COFF_DMAGIC     0410    /* dirty text segment, data aligned        */
152 #define COFF_ZMAGIC     0413    /* The proper     149 #define COFF_ZMAGIC     0413    /* The proper magic number for executables  */
153 #define COFF_SHMAGIC    0443    /* shared libr    150 #define COFF_SHMAGIC    0443    /* shared library header                   */
154                                                   151 
155 /********************** SECTION HEADER *******    152 /********************** SECTION HEADER **********************/
156                                                   153 
157 struct COFF_scnhdr {                              154 struct COFF_scnhdr {
158   char          s_name[8];      /* section nam    155   char          s_name[8];      /* section name                     */
159   char          s_paddr[4];     /* physical ad    156   char          s_paddr[4];     /* physical address, aliased s_nlib */
160   char          s_vaddr[4];     /* virtual add    157   char          s_vaddr[4];     /* virtual address                  */
161   char          s_size[4];      /* section siz    158   char          s_size[4];      /* section size                     */
162   char          s_scnptr[4];    /* file ptr to    159   char          s_scnptr[4];    /* file ptr to raw data for section */
163   char          s_relptr[4];    /* file ptr to    160   char          s_relptr[4];    /* file ptr to relocation           */
164   char          s_lnnoptr[4];   /* file ptr to    161   char          s_lnnoptr[4];   /* file ptr to line numbers         */
165   char          s_nreloc[2];    /* number of r    162   char          s_nreloc[2];    /* number of relocation entries     */
166   char          s_nlnno[2];     /* number of l    163   char          s_nlnno[2];     /* number of line number entries    */
167   char          s_flags[4];     /* flags          164   char          s_flags[4];     /* flags                            */
168 };                                                165 };
169                                                   166 
170 #define COFF_SCNHDR     struct COFF_scnhdr        167 #define COFF_SCNHDR     struct COFF_scnhdr
171 #define COFF_SCNHSZ     sizeof(COFF_SCNHDR)       168 #define COFF_SCNHSZ     sizeof(COFF_SCNHDR)
172                                                   169 
173 /*                                                170 /*
174  * names of "special" sections                    171  * names of "special" sections
175  */                                               172  */
176                                                   173 
177 #define COFF_TEXT       ".text"                   174 #define COFF_TEXT       ".text"
178 #define COFF_DATA       ".data"                   175 #define COFF_DATA       ".data"
179 #define COFF_BSS        ".bss"                    176 #define COFF_BSS        ".bss"
180 #define COFF_COMMENT    ".comment"                177 #define COFF_COMMENT    ".comment"
181 #define COFF_LIB        ".lib"                    178 #define COFF_LIB        ".lib"
182                                                   179 
183 #define COFF_SECT_TEXT  0      /* Section for     180 #define COFF_SECT_TEXT  0      /* Section for instruction code             */
184 #define COFF_SECT_DATA  1      /* Section for     181 #define COFF_SECT_DATA  1      /* Section for initialized globals          */
185 #define COFF_SECT_BSS   2      /* Section for     182 #define COFF_SECT_BSS   2      /* Section for un-initialized globals       */
186 #define COFF_SECT_REQD  3      /* Minimum numb    183 #define COFF_SECT_REQD  3      /* Minimum number of sections for good file */
187                                                   184 
188 #define COFF_STYP_REG     0x00 /* regular segm    185 #define COFF_STYP_REG     0x00 /* regular segment                          */
189 #define COFF_STYP_DSECT   0x01 /* dummy segmen    186 #define COFF_STYP_DSECT   0x01 /* dummy segment                            */
190 #define COFF_STYP_NOLOAD  0x02 /* no-load segm    187 #define COFF_STYP_NOLOAD  0x02 /* no-load segment                          */
191 #define COFF_STYP_GROUP   0x04 /* group segmen    188 #define COFF_STYP_GROUP   0x04 /* group segment                            */
192 #define COFF_STYP_PAD     0x08 /* .pad segment    189 #define COFF_STYP_PAD     0x08 /* .pad segment                             */
193 #define COFF_STYP_COPY    0x10 /* copy section    190 #define COFF_STYP_COPY    0x10 /* copy section                             */
194 #define COFF_STYP_TEXT    0x20 /* .text segmen    191 #define COFF_STYP_TEXT    0x20 /* .text segment                            */
195 #define COFF_STYP_DATA    0x40 /* .data segmen    192 #define COFF_STYP_DATA    0x40 /* .data segment                            */
196 #define COFF_STYP_BSS     0x80 /* .bss segment    193 #define COFF_STYP_BSS     0x80 /* .bss segment                             */
197 #define COFF_STYP_INFO   0x200 /* .comment sec    194 #define COFF_STYP_INFO   0x200 /* .comment section                         */
198 #define COFF_STYP_OVER   0x400 /* overlay sect    195 #define COFF_STYP_OVER   0x400 /* overlay section                          */
199 #define COFF_STYP_LIB    0x800 /* library sect    196 #define COFF_STYP_LIB    0x800 /* library section                          */
200                                                   197 
201 /*                                                198 /*
202  * Shared libraries have the following section    199  * Shared libraries have the following section header in the data field for
203  * each library.                                  200  * each library.
204  */                                               201  */
205                                                   202 
206 struct COFF_slib {                                203 struct COFF_slib {
207   char          sl_entsz[4];    /* Size of thi    204   char          sl_entsz[4];    /* Size of this entry               */
208   char          sl_pathndx[4];  /* size of the    205   char          sl_pathndx[4];  /* size of the header field         */
209 };                                                206 };
210                                                   207 
211 #define COFF_SLIBHD     struct COFF_slib          208 #define COFF_SLIBHD     struct COFF_slib
212 #define COFF_SLIBSZ     sizeof(COFF_SLIBHD)       209 #define COFF_SLIBSZ     sizeof(COFF_SLIBHD)
213                                                   210 
214 /********************** LINE NUMBERS *********    211 /********************** LINE NUMBERS **********************/
215                                                   212 
216 /* 1 line number entry for every "breakpointab    213 /* 1 line number entry for every "breakpointable" source line in a section.
217  * Line numbers are grouped on a per function     214  * Line numbers are grouped on a per function basis; first entry in a function
218  * grouping will have l_lnno = 0 and in place     215  * grouping will have l_lnno = 0 and in place of physical address will be the
219  * symbol table index of the function name.       216  * symbol table index of the function name.
220  */                                               217  */
221                                                   218 
222 struct COFF_lineno {                              219 struct COFF_lineno {
223   union {                                         220   union {
224     char l_symndx[4];   /* function name symbo    221     char l_symndx[4];   /* function name symbol index, iff l_lnno == 0*/
225     char l_paddr[4];    /* (physical) address     222     char l_paddr[4];    /* (physical) address of line number    */
226   } l_addr;                                       223   } l_addr;
227   char l_lnno[2];       /* line number            224   char l_lnno[2];       /* line number          */
228 };                                                225 };
229                                                   226 
230 #define COFF_LINENO     struct COFF_lineno        227 #define COFF_LINENO     struct COFF_lineno
231 #define COFF_LINESZ     6                         228 #define COFF_LINESZ     6
232                                                   229 
233 /********************** SYMBOLS **************    230 /********************** SYMBOLS **********************/
234                                                   231 
235 #define COFF_E_SYMNMLEN  8      /* # character    232 #define COFF_E_SYMNMLEN  8      /* # characters in a short symbol name  */
236 #define COFF_E_FILNMLEN 14      /* # character    233 #define COFF_E_FILNMLEN 14      /* # characters in a file name          */
237 #define COFF_E_DIMNUM    4      /* # array dim    234 #define COFF_E_DIMNUM    4      /* # array dimensions in auxiliary entry */
238                                                   235 
239 /*                                                236 /*
240  *  All symbols and sections have the followin    237  *  All symbols and sections have the following definition
241  */                                               238  */
242                                                   239 
243 struct COFF_syment                                240 struct COFF_syment 
244 {                                                 241 {
245   union {                                         242   union {
246     char e_name[E_SYMNMLEN];    /* Symbol name    243     char e_name[E_SYMNMLEN];    /* Symbol name (first 8 characters) */
247     struct {                                      244     struct {
248       char e_zeroes[4];         /* Leading zer    245       char e_zeroes[4];         /* Leading zeros */
249       char e_offset[4];         /* Offset if t    246       char e_offset[4];         /* Offset if this is a header section */
250     } e;                                          247     } e;
251   } e;                                            248   } e;
252                                                   249 
253   char e_value[4];              /* Value (addr    250   char e_value[4];              /* Value (address) of the segment */
254   char e_scnum[2];              /* Section num    251   char e_scnum[2];              /* Section number */
255   char e_type[2];               /* Type of sec    252   char e_type[2];               /* Type of section */
256   char e_sclass[1];             /* Loader clas    253   char e_sclass[1];             /* Loader class */
257   char e_numaux[1];             /* Number of a    254   char e_numaux[1];             /* Number of auxiliary entries which follow */
258 };                                                255 };
259                                                   256 
260 #define COFF_N_BTMASK   (0xf)   /* Mask for im    257 #define COFF_N_BTMASK   (0xf)   /* Mask for important class bits */
261 #define COFF_N_TMASK    (0x30)  /* Mask for im    258 #define COFF_N_TMASK    (0x30)  /* Mask for important type bits  */
262 #define COFF_N_BTSHFT   (4)     /* # bits to s    259 #define COFF_N_BTSHFT   (4)     /* # bits to shift class field   */
263 #define COFF_N_TSHIFT   (2)     /* # bits to s    260 #define COFF_N_TSHIFT   (2)     /* # bits to shift type field    */
264                                                   261 
265 /*                                                262 /*
266  *  Auxiliary entries because the main table i    263  *  Auxiliary entries because the main table is too limiting.
267  */                                               264  */
268                                                   265   
269 union COFF_auxent {                               266 union COFF_auxent {
270                                                   267 
271 /*                                                268 /*
272  *  Debugger information                          269  *  Debugger information
273  */                                               270  */
274                                                   271 
275   struct {                                        272   struct {
276     char x_tagndx[4];           /* str, un, or    273     char x_tagndx[4];           /* str, un, or enum tag indx */
277     union {                                       274     union {
278       struct {                                    275       struct {
279         char  x_lnno[2];        /* declaration    276         char  x_lnno[2];        /* declaration line number */
280         char  x_size[2];        /* str/union/a    277         char  x_size[2];        /* str/union/array size */
281       } x_lnsz;                                   278       } x_lnsz;
282       char x_fsize[4];          /* size of fun    279       char x_fsize[4];          /* size of function */
283     } x_misc;                                     280     } x_misc;
284                                                   281 
285     union {                                       282     union {
286       struct {                  /* if ISFCN, t    283       struct {                  /* if ISFCN, tag, or .bb */
287         char x_lnnoptr[4];      /* ptr to fcn     284         char x_lnnoptr[4];      /* ptr to fcn line # */
288         char x_endndx[4];       /* entry ndx p    285         char x_endndx[4];       /* entry ndx past block end */
289       } x_fcn;                                    286       } x_fcn;
290                                                   287 
291       struct {                  /* if ISARY, u    288       struct {                  /* if ISARY, up to 4 dimen. */
292         char x_dimen[E_DIMNUM][2];                289         char x_dimen[E_DIMNUM][2];
293       } x_ary;                                    290       } x_ary;
294     } x_fcnary;                                   291     } x_fcnary;
295                                                   292 
296     char x_tvndx[2];    /* tv index */            293     char x_tvndx[2];    /* tv index */
297   } x_sym;                                        294   } x_sym;
298                                                   295 
299 /*                                                296 /*
300  *   Source file names (debugger information)     297  *   Source file names (debugger information)
301  */                                               298  */
302                                                   299 
303   union {                                         300   union {
304     char x_fname[E_FILNMLEN];                     301     char x_fname[E_FILNMLEN];
305     struct {                                      302     struct {
306       char x_zeroes[4];                           303       char x_zeroes[4];
307       char x_offset[4];                           304       char x_offset[4];
308     } x_n;                                        305     } x_n;
309   } x_file;                                       306   } x_file;
310                                                   307 
311 /*                                                308 /*
312  *   Section information                          309  *   Section information
313  */                                               310  */
314                                                   311 
315   struct {                                        312   struct {
316     char x_scnlen[4];   /* section length */      313     char x_scnlen[4];   /* section length */
317     char x_nreloc[2];   /* # relocation entrie    314     char x_nreloc[2];   /* # relocation entries */
318     char x_nlinno[2];   /* # line numbers */      315     char x_nlinno[2];   /* # line numbers */
319   } x_scn;                                        316   } x_scn;
320                                                   317 
321 /*                                                318 /*
322  *   Transfer vector (branch table)               319  *   Transfer vector (branch table)
323  */                                               320  */
324                                                   321   
325   struct {                                        322   struct {
326     char x_tvfill[4];   /* tv fill value */       323     char x_tvfill[4];   /* tv fill value */
327     char x_tvlen[2];    /* length of .tv */       324     char x_tvlen[2];    /* length of .tv */
328     char x_tvran[2][2]; /* tv range */            325     char x_tvran[2][2]; /* tv range */
329   } x_tv;               /* info about .tv sect    326   } x_tv;               /* info about .tv section (in auxent of symbol .tv)) */
330 };                                                327 };
331                                                   328 
332 #define COFF_SYMENT     struct COFF_syment        329 #define COFF_SYMENT     struct COFF_syment
333 #define COFF_SYMESZ     18                        330 #define COFF_SYMESZ     18      
334 #define COFF_AUXENT     union COFF_auxent         331 #define COFF_AUXENT     union COFF_auxent
335 #define COFF_AUXESZ     18                        332 #define COFF_AUXESZ     18
336                                                   333 
337 #define COFF_ETEXT      "etext"                   334 #define COFF_ETEXT      "etext"
338                                                   335 
339 /********************** RELOCATION DIRECTIVES     336 /********************** RELOCATION DIRECTIVES **********************/
340                                                   337 
341 struct COFF_reloc {                               338 struct COFF_reloc {
342   char r_vaddr[4];        /* Virtual address o    339   char r_vaddr[4];        /* Virtual address of item    */
343   char r_symndx[4];       /* Symbol index in t    340   char r_symndx[4];       /* Symbol index in the symtab */
344   char r_type[2];         /* Relocation type      341   char r_type[2];         /* Relocation type            */
345 };                                                342 };
346                                                   343 
347 #define COFF_RELOC struct COFF_reloc              344 #define COFF_RELOC struct COFF_reloc
348 #define COFF_RELSZ 10                             345 #define COFF_RELSZ 10
349                                                   346 
350 #define COFF_DEF_DATA_SECTION_ALIGNMENT  4        347 #define COFF_DEF_DATA_SECTION_ALIGNMENT  4
351 #define COFF_DEF_BSS_SECTION_ALIGNMENT   4        348 #define COFF_DEF_BSS_SECTION_ALIGNMENT   4
352 #define COFF_DEF_TEXT_SECTION_ALIGNMENT  4        349 #define COFF_DEF_TEXT_SECTION_ALIGNMENT  4
353                                                   350 
354 /* For new sections we haven't heard of before    351 /* For new sections we haven't heard of before */
355 #define COFF_DEF_SECTION_ALIGNMENT       4        352 #define COFF_DEF_SECTION_ALIGNMENT       4
356                                                << 
357 #endif /* _UAPI_LINUX_COFF_H */                << 
358                                                   353 

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

sflogo.php