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