1 /* Copyright 1990, 1992 Free Software Foundation, Inc.
3 * This code was donated by Intel Corp.
5 * This is a coff version of a.out.h to support 80960 debugging from
6 * a Unix (possibly BSD) host. It's used by:
7 * o gdb960 to symbols in code generated with Intel (non-GNU) tools.
8 * o comm960 to convert a b.out file to a coff file for download.
12 /********************** FILE HEADER **********************/
15 unsigned short f_magic
; /* magic number */
16 unsigned short f_nscns
; /* number of sections */
17 long f_timdat
; /* time & date stamp */
18 long f_symptr
; /* file pointer to symtab */
19 long f_nsyms
; /* number of symtab entries */
20 unsigned short f_opthdr
; /* sizeof(optional hdr) */
21 unsigned short f_flags
; /* flags */
26 * F_RELFLG relocation info stripped from file
27 * F_EXEC file is executable (no unresolved externel references)
28 * F_LNNO line nunbers stripped from file
29 * F_LSYMS local symbols stripped from file
30 * F_AR32WR file has byte ordering of an AR32WR machine (e.g. vax)
32 #define F_RELFLG 0000001
33 #define F_EXEC 0000002
34 #define F_LNNO 0000004
35 #define F_LSYMS 0000010
36 #define F_AR32WR 0000400
40 * Intel 80960 (I960) processor flags.
41 * F_I960TYPE == mask for processor type field.
43 #define F_I960TYPE 0170000
44 #define F_I960CA 0010000
45 #define F_I960FLOAT 0020000
46 #define F_I960BA 0030000
47 #define F_I960XA 0040000
50 * i80960 Magic Numbers
52 #define I960ROMAGIC 0540 /* read-only text segments */
53 #define I960RWMAGIC 0541 /* read-write text segments */
55 #define I960BADMAG(x) (((x).f_magic!=I960ROMAGIC) && ((x).f_magic!=I960RWMAGIC))
57 #define FILHDR struct filehdr
58 #define FILHSZ sizeof(FILHDR)
61 /********************** AOUT "OPTIONAL HEADER" **********************/
64 unsigned long phys_addr
;
65 unsigned long bitarray
;
68 typedef struct aouthdr
{
69 short magic
; /* type of file */
70 short vstamp
; /* version stamp */
71 unsigned long tsize
; /* text size in bytes, padded to FW bdry*/
72 unsigned long dsize
; /* initialized data " " */
73 unsigned long bsize
; /* uninitialized data " " */
76 unsigned long dum2
; /* pad to entry point */
78 unsigned long entry
; /* entry pt. */
79 unsigned long text_start
; /* base of text used for this file */
80 unsigned long data_start
; /* base of data used for this file */
81 unsigned long tagentries
; /* number of tag entries to follow */
84 /* return a pointer to the tag bits array */
86 #define TAGPTR(aout) ((TAGBITS *) (&(aout.tagentries)+1))
88 /* compute size of a header */
90 #define AOUTSZ(aout) (sizeof(AOUTHDR)+(aout.tagentries*sizeof(TAGBITS)))
92 /********************** STORAGE CLASSES **********************/
94 #define C_EFCN -1 /* physical end of function */
96 #define C_AUTO 1 /* automatic variable */
97 #define C_EXT 2 /* external symbol */
98 #define C_STAT 3 /* static */
99 #define C_REG 4 /* register variable */
100 #define C_EXTDEF 5 /* external definition */
101 #define C_LABEL 6 /* label */
102 #define C_ULABEL 7 /* undefined label */
103 #define C_MOS 8 /* member of structure */
104 #define C_ARG 9 /* function argument */
105 #define C_STRTAG 10 /* structure tag */
106 #define C_MOU 11 /* member of union */
107 #define C_UNTAG 12 /* union tag */
108 #define C_TPDEF 13 /* type definition */
109 #define C_USTATIC 14 /* undefined static */
110 #define C_ENTAG 15 /* enumeration tag */
111 #define C_MOE 16 /* member of enumeration */
112 #define C_REGPARM 17 /* register parameter */
113 #define C_FIELD 18 /* bit field */
114 #define C_BLOCK 100 /* ".bb" or ".eb" */
115 #define C_FCN 101 /* ".bf" or ".ef" */
116 #define C_EOS 102 /* end of structure */
117 #define C_FILE 103 /* file name */
118 #define C_LINE 104 /* line # reformatted as symbol table entry */
119 #define C_ALIAS 105 /* duplicate tag */
120 #define C_HIDDEN 106 /* ext symbol in dmert public lib */
122 /* New storage classes for 80960 */
124 #define C_SCALL 107 /* Procedure reachable via system call */
125 #define C_LEAFPROC 108 /* Leaf procedure, "call" via BAL */
128 /********************** SECTION HEADER **********************/
131 char s_name
[8]; /* section name */
132 long s_paddr
; /* physical address, aliased s_nlib */
133 long s_vaddr
; /* virtual address */
134 long s_size
; /* section size */
135 long s_scnptr
; /* file ptr to raw data for section */
136 long s_relptr
; /* file ptr to relocation */
137 long s_lnnoptr
; /* file ptr to line numbers */
138 unsigned short s_nreloc
; /* number of relocation entries */
139 unsigned short s_nlnno
; /* number of line number entries*/
140 long s_flags
; /* flags */
141 unsigned long s_align
; /* section alignment */
145 * names of "special" sections
147 #define _TEXT ".text"
148 #define _DATA ".data"
154 #define STYP_TEXT 0x20 /* section contains text only */
155 #define STYP_DATA 0x40 /* section contains data only */
156 #define STYP_BSS 0x80 /* section contains bss only */
158 #define SCNHDR struct scnhdr
159 #define SCNHSZ sizeof(SCNHDR)
162 /********************** LINE NUMBERS **********************/
164 /* 1 line number entry for every "breakpointable" source line in a section.
165 * Line numbers are grouped on a per function basis; first entry in a function
166 * grouping will have l_lnno = 0 and in place of physical address will be the
167 * symbol table index of the function name.
171 long l_symndx
; /* function name symbol index, iff l_lnno == 0*/
172 long l_paddr
; /* (physical) address of line number */
174 unsigned short l_lnno
; /* line number */
175 char padding
[2]; /* force alignment */
178 #define LINENO struct lineno
179 #define LINESZ sizeof(LINENO)
182 /********************** SYMBOLS **********************/
184 #define SYMNMLEN 8 /* # characters in a symbol name */
185 #define FILNMLEN 14 /* # characters in a file name */
186 #define DIMNUM 4 /* # array dimensions in auxiliary entry */
191 char _n_name
[SYMNMLEN
]; /* old COFF version */
193 long _n_zeroes
; /* new == 0 */
194 long _n_offset
; /* offset into string table */
196 char *_n_nptr
[2]; /* allows for overlaying */
198 long n_value
; /* value of symbol */
199 short n_scnum
; /* section number */
200 char pad1
[2]; /* force alignment */
201 unsigned long n_type
; /* type and derived type */
202 char n_sclass
; /* storage class */
203 char n_numaux
; /* number of aux. entries */
204 char pad2
[2]; /* force alignment */
207 #define n_name _n._n_name
208 #define n_zeroes _n._n_n._n_zeroes
209 #define n_offset _n._n_n._n_offset
212 * Relocatable symbols have number of the section in which they are defined,
213 * or one of the following:
215 #define N_UNDEF 0 /* undefined symbol */
216 #define N_ABS -1 /* value of symbol is absolute */
217 #define N_DEBUG -2 /* debugging symbol -- symbol value is meaningless */
220 * Type of a symbol, in low 4 bits of the word
223 #define T_VOID 1 /* function argument (only used by compiler) */
224 #define T_CHAR 2 /* character */
225 #define T_SHORT 3 /* short integer */
226 #define T_INT 4 /* integer */
227 #define T_LONG 5 /* long integer */
228 #define T_FLOAT 6 /* floating point */
229 #define T_DOUBLE 7 /* double word */
230 #define T_STRUCT 8 /* structure */
231 #define T_UNION 9 /* union */
232 #define T_ENUM 10 /* enumeration */
233 #define T_MOE 11 /* member of enumeration*/
234 #define T_UCHAR 12 /* unsigned character */
235 #define T_USHORT 13 /* unsigned short */
236 #define T_UINT 14 /* unsigned integer */
237 #define T_ULONG 15 /* unsigned long */
238 #define T_LNGDBL 16 /* long double */
244 #define DT_PTR 1 /* pointer */
245 #define DT_FCN 2 /* function */
246 #define DT_ARY 3 /* array */
253 #define BTYPE(x) ((x) & N_BTMASK)
256 #define ISPTR(x) (((x) & N_TMASK) == (DT_PTR << N_BTSHFT))
257 #define ISFCN(x) (((x) & N_TMASK) == (DT_FCN << N_BTSHFT))
258 #define ISARY(x) (((x) & N_TMASK) == (DT_ARY << N_BTSHFT))
260 #define DECREF(x) ((((x)>>N_TSHIFT)&~N_BTMASK)|((x)&N_BTMASK))
264 long x_tagndx
; /* str, un, or enum tag indx */
267 unsigned short x_lnno
; /* declaration line number */
268 unsigned short x_size
; /* str/union/array size */
270 long x_fsize
; /* size of function */
273 struct { /* if ISFCN, tag, or .bb */
274 long x_lnnoptr
; /* ptr to fcn line # */
275 long x_endndx
; /* entry ndx past block end */
277 struct { /* if ISARY, up to 4 dimen. */
278 unsigned short x_dimen
[DIMNUM
];
281 unsigned short x_tvndx
; /* tv index */
285 char x_fname
[FILNMLEN
];
293 long x_scnlen
; /* section length */
294 unsigned short x_nreloc
; /* # relocation entries */
295 unsigned short x_nlinno
; /* # line numbers */
303 unsigned long x_balntry
;
306 char a
[sizeof(struct syment
)]; /* force auxent/syment sizes to match */
309 #define SYMENT struct syment
310 #define SYMESZ sizeof(SYMENT)
311 #define AUXENT union auxent
312 #define AUXESZ sizeof(AUXENT)
315 # define _ETEXT "_etext"
317 # define _ETEXT "etext"
320 /********************** RELOCATION DIRECTIVES **********************/
323 long r_vaddr
; /* Virtual address of reference */
324 long r_symndx
; /* Index into symbol table */
325 unsigned short r_type
; /* Relocation type */
326 char pad
[2]; /* Unused */
329 /* Only values of r_type GNU/960 cares about */
330 #define R_RELLONG 17 /* Direct 32-bit relocation */
331 #define R_IPRMED 25 /* 24-bit ip-relative relocation */
332 #define R_OPTCALL 27 /* 32-bit optimizable call (leafproc/sysproc) */
335 #define RELOC struct reloc
336 #define RELSZ sizeof(RELOC)
This page took 0.035414 seconds and 4 git commands to generate.