]>
Commit | Line | Data |
---|---|---|
da40dd53 ILT |
1 | /* This file was hacked from i386.h [[email protected]] */ |
2 | ||
3 | /*** coff information for Intel 860. */ | |
4 | ||
5 | ||
6 | /********************** FILE HEADER **********************/ | |
7 | ||
8 | struct external_filehdr { | |
9 | char f_magic[2]; /* magic number */ | |
10 | char f_nscns[2]; /* number of sections */ | |
11 | char f_timdat[4]; /* time & date stamp */ | |
12 | char f_symptr[4]; /* file pointer to symtab */ | |
13 | char f_nsyms[4]; /* number of symtab entries */ | |
14 | char f_opthdr[2]; /* sizeof(optional hdr) */ | |
15 | char f_flags[2]; /* flags */ | |
16 | }; | |
17 | ||
18 | ||
19 | /* Bits for f_flags: | |
20 | * F_RELFLG relocation info stripped from file | |
21 | * F_EXEC file is executable (no unresolved external references) | |
22 | * F_LNNO line numbers stripped from file | |
23 | * F_LSYMS local symbols stripped from file | |
24 | * F_AR32WR file has byte ordering of an AR32WR machine (e.g. vax) | |
25 | */ | |
26 | ||
27 | #define F_RELFLG (0x0001) | |
28 | #define F_EXEC (0x0002) | |
29 | #define F_LNNO (0x0004) | |
30 | #define F_LSYMS (0x0008) | |
31 | ||
32 | ||
33 | ||
34 | #define I860MAGIC 0x14d | |
35 | ||
36 | #define I860BADMAG(x) ((x).f_magic != I860MAGIC) | |
37 | ||
38 | #define FILHDR struct external_filehdr | |
39 | #define FILHSZ sizeof(FILHDR) | |
40 | ||
41 | ||
42 | /********************** AOUT "OPTIONAL HEADER" **********************/ | |
43 | ||
44 | ||
45 | typedef struct | |
46 | { | |
47 | char magic[2]; /* type of file */ | |
48 | char vstamp[2]; /* version stamp */ | |
49 | char tsize[4]; /* text size in bytes, padded to FW bdry*/ | |
50 | char dsize[4]; /* initialized data " " */ | |
51 | char bsize[4]; /* uninitialized data " " */ | |
52 | char entry[4]; /* entry pt. */ | |
53 | char text_start[4]; /* base of text used for this file */ | |
54 | char data_start[4]; /* base of data used for this file */ | |
55 | } | |
56 | AOUTHDR; | |
57 | ||
58 | ||
59 | #define AOUTSZ (sizeof(AOUTHDR)) | |
60 | ||
61 | /* FIXME: What are the a.out magic numbers? */ | |
62 | ||
63 | /********************** SECTION HEADER **********************/ | |
64 | ||
65 | ||
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 */ | |
77 | }; | |
78 | ||
79 | #define SCNHDR struct external_scnhdr | |
80 | #define SCNHSZ sizeof(SCNHDR) | |
81 | ||
82 | /* | |
83 | * names of "special" sections | |
84 | */ | |
85 | #define _TEXT ".text" | |
86 | #define _DATA ".data" | |
87 | #define _BSS ".bss" | |
88 | #define _COMMENT ".comment" | |
89 | #define _LIB ".lib" | |
90 | ||
91 | /********************** LINE NUMBERS **********************/ | |
92 | ||
93 | /* 1 line number entry for every "breakpointable" source line in a section. | |
94 | * Line numbers are grouped on a per function basis; first entry in a function | |
95 | * grouping will have l_lnno = 0 and in place of physical address will be the | |
96 | * symbol table index of the function name. | |
97 | */ | |
98 | struct external_lineno { | |
99 | union { | |
100 | char l_symndx[4]; /* function name symbol index, iff l_lnno == 0*/ | |
101 | char l_paddr[4]; /* (physical) address of line number */ | |
102 | } l_addr; | |
103 | char l_lnno[2]; /* line number */ | |
104 | }; | |
105 | ||
106 | ||
107 | #define LINENO struct external_lineno | |
108 | #define LINESZ 6 | |
109 | ||
110 | ||
111 | /********************** SYMBOLS **********************/ | |
112 | ||
113 | #define E_SYMNMLEN 8 /* # characters in a symbol name */ | |
114 | #define E_FILNMLEN 14 /* # characters in a file name */ | |
115 | #define E_DIMNUM 4 /* # array dimensions in auxiliary entry */ | |
116 | ||
117 | struct external_syment | |
118 | { | |
119 | union { | |
120 | char e_name[E_SYMNMLEN]; | |
121 | struct { | |
122 | char e_zeroes[4]; | |
123 | char e_offset[4]; | |
124 | } e; | |
125 | } e; | |
126 | char e_value[4]; | |
127 | char e_scnum[2]; | |
128 | char e_type[2]; | |
129 | char e_sclass[1]; | |
130 | char e_numaux[1]; | |
131 | }; | |
132 | ||
133 | #define N_BTMASK (0xf) | |
134 | #define N_TMASK (0x30) | |
135 | #define N_BTSHFT (4) | |
136 | #define N_TSHIFT (2) | |
137 | ||
138 | union external_auxent { | |
139 | struct { | |
140 | char x_tagndx[4]; /* str, un, or enum tag indx */ | |
141 | union { | |
142 | struct { | |
143 | char x_lnno[2]; /* declaration line number */ | |
144 | char x_size[2]; /* str/union/array size */ | |
145 | } x_lnsz; | |
146 | char x_fsize[4]; /* size of function */ | |
147 | } x_misc; | |
148 | union { | |
149 | struct { /* if ISFCN, tag, or .bb */ | |
150 | char x_lnnoptr[4]; /* ptr to fcn line # */ | |
151 | char x_endndx[4]; /* entry ndx past block end */ | |
152 | } x_fcn; | |
153 | struct { /* if ISARY, up to 4 dimen. */ | |
154 | char x_dimen[E_DIMNUM][2]; | |
155 | } x_ary; | |
156 | } x_fcnary; | |
157 | char x_tvndx[2]; /* tv index */ | |
158 | } x_sym; | |
159 | ||
160 | union { | |
161 | char x_fname[E_FILNMLEN]; | |
162 | struct { | |
163 | char x_zeroes[4]; | |
164 | char x_offset[4]; | |
165 | } x_n; | |
166 | } x_file; | |
167 | ||
168 | struct { | |
169 | char x_scnlen[4]; /* section length */ | |
170 | char x_nreloc[2]; /* # relocation entries */ | |
171 | char x_nlinno[2]; /* # line numbers */ | |
172 | } x_scn; | |
173 | ||
174 | struct { | |
175 | char x_tvfill[4]; /* tv fill value */ | |
176 | char x_tvlen[2]; /* length of .tv */ | |
177 | char x_tvran[2][2]; /* tv range */ | |
178 | } x_tv; /* info about .tv section (in auxent of symbol .tv)) */ | |
179 | ||
180 | ||
181 | }; | |
182 | ||
183 | #define SYMENT struct external_syment | |
184 | #define SYMESZ 18 | |
185 | #define AUXENT union external_auxent | |
186 | #define AUXESZ 18 | |
187 | ||
188 | ||
189 | # define _ETEXT "etext" | |
190 | ||
191 | ||
192 | /********************** RELOCATION DIRECTIVES **********************/ | |
193 | ||
194 | ||
195 | ||
196 | struct external_reloc { | |
197 | char r_vaddr[4]; | |
198 | char r_symndx[4]; | |
199 | char r_type[2]; | |
200 | }; | |
201 | ||
202 | ||
203 | #define RELOC struct external_reloc | |
204 | #define RELSZ 10 |