* tic80.h (TIC80MAGIC): Renamed to TIC80_AOUTHDR_MAGIC.
[deliverable/binutils-gdb.git] / include / coff / i960.h
1 /*** coff information for 80960. Origins: Intel corp, natch. */
2
3 /* NOTE: Tagentries (cf TAGBITS) are no longer used by the 960 */
4
5 /********************** FILE HEADER **********************/
6
7 struct external_filehdr {
8 char f_magic[2]; /* magic number */
9 char f_nscns[2]; /* number of sections */
10 char f_timdat[4]; /* time & date stamp */
11 char f_symptr[4]; /* file pointer to symtab */
12 char f_nsyms[4]; /* number of symtab entries */
13 char f_opthdr[2]; /* sizeof(optional hdr) */
14 char f_flags[2]; /* flags */
15 };
16
17 #define OMAGIC (0407) /* old impure format. data immediately
18 follows text. both sections are rw. */
19 #define NMAGIC (0410) /* split i&d, read-only text */
20
21 /*
22 * Intel 80960 (I960) processor flags.
23 * F_I960TYPE == mask for processor type field.
24 */
25
26 #define F_I960TYPE (0xf000)
27 #define F_I960CORE (0x1000)
28 #define F_I960KB (0x2000)
29 #define F_I960SB (0x2000)
30 #define F_I960MC (0x3000)
31 #define F_I960XA (0x4000)
32 #define F_I960CA (0x5000)
33 #define F_I960KA (0x6000)
34 #define F_I960SA (0x6000)
35 /* start-sanitize-i960xl */
36 #define F_I960XL (0x7000)
37 /* end-sanitize-i960xl */
38 #define F_I960HX (0x8000)
39
40
41 /** i80960 Magic Numbers
42 */
43
44 #define I960ROMAGIC (0x160) /* read-only text segments */
45 #define I960RWMAGIC (0x161) /* read-write text segments */
46
47 #define I960BADMAG(x) (((x).f_magic!=I960ROMAGIC) && ((x).f_magic!=I960RWMAGIC))
48
49 #define FILHDR struct external_filehdr
50 #define FILHSZ 20
51
52 /********************** AOUT "OPTIONAL HEADER" **********************/
53
54 typedef struct {
55 unsigned long phys_addr;
56 unsigned long bitarray;
57 } TAGBITS;
58
59
60
61 typedef struct
62 {
63 char magic[2]; /* type of file */
64 char vstamp[2]; /* version stamp */
65 char tsize[4]; /* text size in bytes, padded to FW bdry*/
66 char dsize[4]; /* initialized data " " */
67 char bsize[4]; /* uninitialized data " " */
68 char entry[4]; /* entry pt. */
69 char text_start[4]; /* base of text used for this file */
70 char data_start[4]; /* base of data used for this file */
71 char tagentries[4]; /* number of tag entries to follow */
72 }
73 AOUTHDR;
74
75 /* return a pointer to the tag bits array */
76
77 #define TAGPTR(aout) ((TAGBITS *) (&(aout.tagentries)+1))
78
79 /* compute size of a header */
80
81 /*#define AOUTSZ(aout) (sizeof(AOUTHDR)+(aout.tagentries*sizeof(TAGBITS)))*/
82 #define AOUTSZ (sizeof(AOUTHDR))
83
84
85
86 /********************** SECTION HEADER **********************/
87
88
89 struct external_scnhdr {
90 char s_name[8]; /* section name */
91 char s_paddr[4]; /* physical address, aliased s_nlib */
92 char s_vaddr[4]; /* virtual address */
93 char s_size[4]; /* section size */
94 char s_scnptr[4]; /* file ptr to raw data for section */
95 char s_relptr[4]; /* file ptr to relocation */
96 char s_lnnoptr[4]; /* file ptr to line numbers */
97 char s_nreloc[2]; /* number of relocation entries */
98 char s_nlnno[2]; /* number of line number entries*/
99 char s_flags[4]; /* flags */
100 char s_align[4]; /* section alignment */
101 };
102
103
104 #define SCNHDR struct external_scnhdr
105 #define SCNHSZ sizeof(SCNHDR)
106
107 /*
108 * names of "special" sections
109 */
110 #define _TEXT ".text"
111 #define _DATA ".data"
112 #define _BSS ".bss"
113
114 /********************** LINE NUMBERS **********************/
115
116 /* 1 line number entry for every "breakpointable" source line in a section.
117 * Line numbers are grouped on a per function basis; first entry in a function
118 * grouping will have l_lnno = 0 and in place of physical address will be the
119 * symbol table index of the function name.
120 */
121 struct external_lineno {
122 union {
123 char l_symndx[4]; /* function name symbol index, iff l_lnno == 0*/
124 char l_paddr[4]; /* (physical) address of line number */
125 } l_addr;
126 char l_lnno[2]; /* line number */
127 char padding[2]; /* force alignment */
128 };
129
130
131 #define LINENO struct external_lineno
132 #define LINESZ 8
133
134
135 /********************** SYMBOLS **********************/
136
137 #define E_SYMNMLEN 8 /* # characters in a symbol name */
138 #define E_FILNMLEN 14 /* # characters in a file name */
139 #define E_DIMNUM 4 /* # array dimensions in auxiliary entry */
140
141 struct external_syment
142 {
143 union {
144 char e_name[E_SYMNMLEN];
145 struct {
146 char e_zeroes[4];
147 char e_offset[4];
148 } e;
149 } e;
150 char e_value[4];
151 char e_scnum[2];
152 char e_flags[2];
153 char e_type[4];
154 char e_sclass[1];
155 char e_numaux[1];
156 char pad2[2];
157 };
158
159
160
161
162 #define N_BTMASK (0x1f)
163 #define N_TMASK (0x60)
164 #define N_BTSHFT (5)
165 #define N_TSHIFT (2)
166
167 union external_auxent {
168 struct {
169 char x_tagndx[4]; /* str, un, or enum tag indx */
170 union {
171 struct {
172 char x_lnno[2]; /* declaration line number */
173 char x_size[2]; /* str/union/array size */
174 } x_lnsz;
175 char x_fsize[4]; /* size of function */
176 } x_misc;
177 union {
178 struct { /* if ISFCN, tag, or .bb */
179 char x_lnnoptr[4]; /* ptr to fcn line # */
180 char x_endndx[4]; /* entry ndx past block end */
181 } x_fcn;
182 struct { /* if ISARY, up to 4 dimen. */
183 char x_dimen[E_DIMNUM][2];
184 } x_ary;
185 } x_fcnary;
186 char x_tvndx[2]; /* tv index */
187 } x_sym;
188
189 union {
190 char x_fname[E_FILNMLEN];
191 struct {
192 char x_zeroes[4];
193 char x_offset[4];
194 } x_n;
195 } x_file;
196
197 struct {
198 char x_scnlen[4]; /* section length */
199 char x_nreloc[2]; /* # relocation entries */
200 char x_nlinno[2]; /* # line numbers */
201 } x_scn;
202
203 struct {
204 char x_tvfill[4]; /* tv fill value */
205 char x_tvlen[2]; /* length of .tv */
206 char x_tvran[2][2]; /* tv range */
207 } x_tv; /* info about .tv section (in auxent of symbol .tv)) */
208
209 /******************************************
210 * I960-specific *2nd* aux. entry formats
211 ******************************************/
212 struct {
213 /* This is a very old typo that keeps getting propagated. */
214 #define x_stdindx x_stindx
215 char x_stindx[4]; /* sys. table entry */
216 } x_sc; /* system call entry */
217
218 struct {
219 char x_balntry[4]; /* BAL entry point */
220 } x_bal; /* BAL-callable function */
221
222 struct {
223 char x_timestamp[4]; /* time stamp */
224 char x_idstring[20]; /* producer identity string */
225 } x_ident; /* Producer ident info */
226
227 };
228
229
230
231 #define SYMENT struct external_syment
232 #define SYMESZ sizeof(SYMENT) /* FIXME - calc by hand */
233 #define AUXENT union external_auxent
234 #define AUXESZ sizeof(AUXENT) /* FIXME - calc by hand */
235
236 # define _ETEXT "_etext"
237
238 /********************** RELOCATION DIRECTIVES **********************/
239
240 struct external_reloc {
241 char r_vaddr[4];
242 char r_symndx[4];
243 char r_type[2];
244 char pad[2];
245 };
246
247
248 /* Relevent values for r_type and i960. Would someone please document them */
249
250
251 #define RELOC struct external_reloc
252 #define RELSZ 12
253
This page took 0.034634 seconds and 4 git commands to generate.