1 /*** coff information for we32k */
3 /********************** FILE HEADER **********************/
5 struct external_filehdr
{
6 char f_magic
[2]; /* magic number */
7 char f_nscns
[2]; /* number of sections */
8 char f_timdat
[4]; /* time & date stamp */
9 char f_symptr
[4]; /* file pointer to symtab */
10 char f_nsyms
[4]; /* number of symtab entries */
11 char f_opthdr
[2]; /* sizeof(optional hdr) */
12 char f_flags
[2]; /* flags */
17 * F_RELFLG relocation info stripped from file
18 * F_EXEC file is executable (no unresolved external references)
19 * F_LNNO line numbers stripped from file
20 * F_LSYMS local symbols stripped from file
21 * F_AR32WR file has byte ordering of an AR32WR machine (e.g. vax)
24 #define F_RELFLG (0x0001)
25 #define F_EXEC (0x0002)
26 #define F_LNNO (0x0004)
27 #define F_LSYMS (0x0008)
28 #define F_BM32B (0020000)
29 #define F_BM32MAU (0040000)
31 #define WE32KMAGIC 0x170 /* we32k sans transfer vector */
32 #define FBOMAGIC 0x170 /* we32k sans transfer vector */
33 #define MTVMAGIC 0x171 /* we32k with transfer vector */
34 #define RBOMAGIC 0x172 /* reserved */
35 #define WE32KBADMAG(x) (((x).f_magic != WE32KMAGIC) \
36 && ((x).f_magic != FBOMAGIC) \
37 && ((x).f_magic != RBOMAGIC) \
38 && ((x).f_magic != MTVMAGIC))
40 #define FILHDR struct external_filehdr
44 /********************** AOUT "OPTIONAL HEADER" **********************/
49 char magic
[2]; /* type of file */
50 char vstamp
[2]; /* version stamp */
51 char tsize
[4]; /* text size in bytes, padded to FW bdry*/
52 char dsize
[4]; /* initialized data " " */
53 char bsize
[4]; /* uninitialized data " " */
54 char entry
[4]; /* entry pt. */
55 char text_start
[4]; /* base of text used for this file */
56 char data_start
[4]; /* base of data used for this file */
63 /********************** SECTION HEADER **********************/
66 struct external_scnhdr
{
67 char s_name
[8]; /* section name */
68 char s_paddr
[4]; /* physical address, aliased s_nlib */
69 char s_vaddr
[4]; /* virtual address */
70 char s_size
[4]; /* section size */
71 char s_scnptr
[4]; /* file ptr to raw data for section */
72 char s_relptr
[4]; /* file ptr to relocation */
73 char s_lnnoptr
[4]; /* file ptr to line numbers */
74 char s_nreloc
[2]; /* number of relocation entries */
75 char s_nlnno
[2]; /* number of line number entries*/
76 char s_flags
[4]; /* flags */
79 #define SCNHDR struct external_scnhdr
83 * names of "special" sections
92 /********************** LINE NUMBERS **********************/
94 /* 1 line number entry for every "breakpointable" source line in a section.
95 * Line numbers are grouped on a per function basis; first entry in a function
96 * grouping will have l_lnno = 0 and in place of physical address will be the
97 * symbol table index of the function name.
99 struct external_lineno
{
101 char l_symndx
[4]; /* function name symbol index, iff l_lnno == 0*/
102 char l_paddr
[4]; /* (physical) address of line number */
104 char l_lnno
[2]; /* line number */
108 #define LINENO struct external_lineno
112 /********************** SYMBOLS **********************/
114 #define E_SYMNMLEN 8 /* # characters in a symbol name */
115 #define E_FILNMLEN 14 /* # characters in a file name */
116 #define E_DIMNUM 4 /* # array dimensions in auxiliary entry */
118 struct external_syment
121 char e_name
[E_SYMNMLEN
];
134 #define N_BTMASK (0xf)
135 #define N_TMASK (0x30)
139 union external_auxent
{
141 char x_tagndx
[4]; /* str, un, or enum tag indx */
144 char x_lnno
[2]; /* declaration line number */
145 char x_size
[2]; /* str/union/array size */
147 char x_fsize
[4]; /* size of function */
150 struct { /* if ISFCN, tag, or .bb */
151 char x_lnnoptr
[4]; /* ptr to fcn line # */
152 char x_endndx
[4]; /* entry ndx past block end */
154 struct { /* if ISARY, up to 4 dimen. */
155 char x_dimen
[E_DIMNUM
][2];
158 char x_tvndx
[2]; /* tv index */
162 char x_fname
[E_FILNMLEN
];
170 char x_scnlen
[4]; /* section length */
171 char x_nreloc
[2]; /* # relocation entries */
172 char x_nlinno
[2]; /* # line numbers */
176 char x_tvfill
[4]; /* tv fill value */
177 char x_tvlen
[2]; /* length of .tv */
178 char x_tvran
[2][2]; /* tv range */
179 } x_tv
; /* info about .tv section (in auxent of symbol .tv)) */
184 #define SYMENT struct external_syment
186 #define AUXENT union external_auxent
190 # define _ETEXT "etext"
193 /********************** RELOCATION DIRECTIVES **********************/
197 struct external_reloc
{
204 #define RELOC struct external_reloc