source: trunk/src/binutils/include/coff/i960.h@ 10

Last change on this file since 10 was 10, checked in by bird, 23 years ago

Initial revision

  • Property cvs2svn:cvs-rev set to 1.1
  • Property svn:eol-style set to native
  • Property svn:executable set to *
File size: 8.3 KB
Line 
1/* coff information for 80960. Origins: Intel corp, natch.
2
3 Copyright 2001 Free Software Foundation, Inc.
4
5 This program is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation; either version 2 of the License, or
8 (at your option) any later version.
9
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
14
15 You should have received a copy of the GNU General Public License
16 along with this program; if not, write to the Free Software
17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
18
19/* NOTE: Tagentries (cf TAGBITS) are no longer used by the 960 */
20
21/********************** FILE HEADER **********************/
22
23struct external_filehdr {
24 char f_magic[2]; /* magic number */
25 char f_nscns[2]; /* number of sections */
26 char f_timdat[4]; /* time & date stamp */
27 char f_symptr[4]; /* file pointer to symtab */
28 char f_nsyms[4]; /* number of symtab entries */
29 char f_opthdr[2]; /* sizeof(optional hdr) */
30 char f_flags[2]; /* flags */
31};
32
33#define OMAGIC (0407) /* old impure format. data immediately
34 follows text. both sections are rw. */
35#define NMAGIC (0410) /* split i&d, read-only text */
36
37/*
38* Intel 80960 (I960) processor flags.
39* F_I960TYPE == mask for processor type field.
40*/
41
42#define F_I960TYPE (0xf000)
43#define F_I960CORE (0x1000)
44#define F_I960KB (0x2000)
45#define F_I960SB (0x2000)
46#define F_I960MC (0x3000)
47#define F_I960XA (0x4000)
48#define F_I960CA (0x5000)
49#define F_I960KA (0x6000)
50#define F_I960SA (0x6000)
51#define F_I960JX (0x7000)
52#define F_I960HX (0x8000)
53
54
55/** i80960 Magic Numbers
56*/
57
58#define I960ROMAGIC (0x160) /* read-only text segments */
59#define I960RWMAGIC (0x161) /* read-write text segments */
60
61#define I960BADMAG(x) (((x).f_magic!=I960ROMAGIC) && ((x).f_magic!=I960RWMAGIC))
62
63#define FILHDR struct external_filehdr
64#define FILHSZ 20
65
66/********************** AOUT "OPTIONAL HEADER" **********************/
67
68typedef struct {
69 unsigned long phys_addr;
70 unsigned long bitarray;
71} TAGBITS;
72
73
74
75typedef struct
76{
77 char magic[2]; /* type of file */
78 char vstamp[2]; /* version stamp */
79 char tsize[4]; /* text size in bytes, padded to FW bdry*/
80 char dsize[4]; /* initialized data " " */
81 char bsize[4]; /* uninitialized data " " */
82 char entry[4]; /* entry pt. */
83 char text_start[4]; /* base of text used for this file */
84 char data_start[4]; /* base of data used for this file */
85 char tagentries[4]; /* number of tag entries to follow */
86}
87AOUTHDR;
88
89/* return a pointer to the tag bits array */
90
91#define TAGPTR(aout) ((TAGBITS *) (&(aout.tagentries)+1))
92
93/* compute size of a header */
94
95/*#define AOUTSZ(aout) (sizeof(AOUTHDR)+(aout.tagentries*sizeof(TAGBITS)))*/
96#define AOUTSZ 32
97#define AOUTHDRSZ 32
98
99
100/********************** SECTION HEADER **********************/
101
102
103struct external_scnhdr {
104 char s_name[8]; /* section name */
105 char s_paddr[4]; /* physical address, aliased s_nlib */
106 char s_vaddr[4]; /* virtual address */
107 char s_size[4]; /* section size */
108 char s_scnptr[4]; /* file ptr to raw data for section */
109 char s_relptr[4]; /* file ptr to relocation */
110 char s_lnnoptr[4]; /* file ptr to line numbers */
111 char s_nreloc[2]; /* number of relocation entries */
112 char s_nlnno[2]; /* number of line number entries*/
113 char s_flags[4]; /* flags */
114 char s_align[4]; /* section alignment */
115};
116
117
118#define SCNHDR struct external_scnhdr
119#define SCNHSZ 44
120
121/*
122 * names of "special" sections
123 */
124#define _TEXT ".text"
125#define _DATA ".data"
126#define _BSS ".bss"
127
128/********************** LINE NUMBERS **********************/
129
130/* 1 line number entry for every "breakpointable" source line in a section.
131 * Line numbers are grouped on a per function basis; first entry in a function
132 * grouping will have l_lnno = 0 and in place of physical address will be the
133 * symbol table index of the function name.
134 */
135struct external_lineno {
136 union {
137 char l_symndx[4]; /* function name symbol index, iff l_lnno == 0*/
138 char l_paddr[4]; /* (physical) address of line number */
139 } l_addr;
140 char l_lnno[2]; /* line number */
141 char padding[2]; /* force alignment */
142};
143
144
145#define LINENO struct external_lineno
146#define LINESZ 8
147
148
149/********************** SYMBOLS **********************/
150
151#define E_SYMNMLEN 8 /* # characters in a symbol name */
152#define E_FILNMLEN 14 /* # characters in a file name */
153#define E_DIMNUM 4 /* # array dimensions in auxiliary entry */
154
155struct external_syment
156{
157 union {
158 char e_name[E_SYMNMLEN];
159 struct {
160 char e_zeroes[4];
161 char e_offset[4];
162 } e;
163 } e;
164 char e_value[4];
165 char e_scnum[2];
166 char e_flags[2];
167 char e_type[4];
168 char e_sclass[1];
169 char e_numaux[1];
170 char pad2[2];
171};
172
173
174
175
176#define N_BTMASK (0x1f)
177#define N_TMASK (0x60)
178#define N_BTSHFT (5)
179#define N_TSHIFT (2)
180
181union external_auxent {
182 struct {
183 char x_tagndx[4]; /* str, un, or enum tag indx */
184 union {
185 struct {
186 char x_lnno[2]; /* declaration line number */
187 char x_size[2]; /* str/union/array size */
188 } x_lnsz;
189 char x_fsize[4]; /* size of function */
190 } x_misc;
191 union {
192 struct { /* if ISFCN, tag, or .bb */
193 char x_lnnoptr[4]; /* ptr to fcn line # */
194 char x_endndx[4]; /* entry ndx past block end */
195 } x_fcn;
196 struct { /* if ISARY, up to 4 dimen. */
197 char x_dimen[E_DIMNUM][2];
198 } x_ary;
199 } x_fcnary;
200 char x_tvndx[2]; /* tv index */
201 } x_sym;
202
203 union {
204 char x_fname[E_FILNMLEN];
205 struct {
206 char x_zeroes[4];
207 char x_offset[4];
208 } x_n;
209 } x_file;
210
211 struct {
212 char x_scnlen[4]; /* section length */
213 char x_nreloc[2]; /* # relocation entries */
214 char x_nlinno[2]; /* # line numbers */
215 } x_scn;
216
217 struct {
218 char x_tvfill[4]; /* tv fill value */
219 char x_tvlen[2]; /* length of .tv */
220 char x_tvran[2][2]; /* tv range */
221 } x_tv; /* info about .tv section (in auxent of symbol .tv)) */
222
223 /******************************************
224 * I960-specific *2nd* aux. entry formats
225 ******************************************/
226 struct {
227 /* This is a very old typo that keeps getting propagated. */
228#define x_stdindx x_stindx
229 char x_stindx[4]; /* sys. table entry */
230 } x_sc; /* system call entry */
231
232 struct {
233 char x_balntry[4]; /* BAL entry point */
234 } x_bal; /* BAL-callable function */
235
236 struct {
237 char x_timestamp[4]; /* time stamp */
238 char x_idstring[20]; /* producer identity string */
239 } x_ident; /* Producer ident info */
240
241};
242
243
244
245#define SYMENT struct external_syment
246#define SYMESZ 24
247#define AUXENT union external_auxent
248#define AUXESZ 24
249
250# define _ETEXT "_etext"
251
252/********************** RELOCATION DIRECTIVES **********************/
253
254struct external_reloc {
255 char r_vaddr[4];
256 char r_symndx[4];
257 char r_type[2];
258 char pad[2];
259};
260
261/* r_type values for the i960. */
262
263/* The i960 uses R_RELLONG, which is defined in internal.h as 0x11.
264 It is an absolute 32 bit relocation. */
265
266#define R_IPRMED (0x19) /* 24-bit ip-relative relocation */
267#define R_OPTCALL (0x1b) /* 32-bit optimizable call (leafproc/sysproc) */
268#define R_OPTCALLX (0x1c) /* 64-bit optimizable call (leafproc/sysproc) */
269
270/* The following relocation types are defined use by relaxing linkers,
271 which convert 32 bit calls (which require a 64 bit instruction)
272 into 24 bit calls (which require a 32 bit instruction) when
273 possible. It will be possible whenever the target of the call is
274 within a 24 bit range of the call instruction.
275
276 It is always safe to ignore these relocations. They only serve to
277 mark points which the relaxing linker will have to consider. The
278 assembler must ensure that the correct code is generated even if
279 the relocations are ignored. In particular, this means that the
280 R_IPR13 relocation may not appear with an external symbol. */
281
282#define R_IPR13 (0x1d) /* 13 bit ip-relative branch */
283#define R_ALIGN (0x1e) /* alignment marker. This has no
284 associated symbol. Instead, the
285 r_symndx field indicates the
286 require alignment at this point in
287 the file. It must be a power of 2. */
288
289#define RELOC struct external_reloc
290#define RELSZ 12
291
Note: See TracBrowser for help on using the repository browser.