1 /* coff information for 80960. Origins: Intel corp, natch.
3 Copyright 2001 Free Software Foundation, Inc.
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.
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.
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., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */
19 /* NOTE: Tagentries (cf TAGBITS) are no longer used by the 960 */
21 /********************** FILE HEADER **********************/
23 struct external_filehdr
25 char f_magic
[2]; /* magic number */
26 char f_nscns
[2]; /* number of sections */
27 char f_timdat
[4]; /* time & date stamp */
28 char f_symptr
[4]; /* file pointer to symtab */
29 char f_nsyms
[4]; /* number of symtab entries */
30 char f_opthdr
[2]; /* sizeof(optional hdr) */
31 char f_flags
[2]; /* flags */
34 #define OMAGIC (0407) /* old impure format. data immediately
35 follows text. both sections are rw. */
36 #define NMAGIC (0410) /* split i&d, read-only text */
39 * Intel 80960 (I960) processor flags.
40 * F_I960TYPE == mask for processor type field.
43 #define F_I960TYPE (0xf000)
44 #define F_I960CORE (0x1000)
45 #define F_I960KB (0x2000)
46 #define F_I960SB (0x2000)
47 #define F_I960MC (0x3000)
48 #define F_I960XA (0x4000)
49 #define F_I960CA (0x5000)
50 #define F_I960KA (0x6000)
51 #define F_I960SA (0x6000)
52 #define F_I960JX (0x7000)
53 #define F_I960HX (0x8000)
56 /** i80960 Magic Numbers
59 #define I960ROMAGIC (0x160) /* read-only text segments */
60 #define I960RWMAGIC (0x161) /* read-write text segments */
62 #define I960BADMAG(x) (((x).f_magic!=I960ROMAGIC) && ((x).f_magic!=I960RWMAGIC))
64 #define FILHDR struct external_filehdr
67 /********************** AOUT "OPTIONAL HEADER" **********************/
71 unsigned long phys_addr
;
72 unsigned long bitarray
;
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 */
89 /* return a pointer to the tag bits array */
91 #define TAGPTR(aout) ((TAGBITS *) (&(aout.tagentries)+1))
93 /* compute size of a header */
95 /*#define AOUTSZ(aout) (sizeof(AOUTHDR)+(aout.tagentries*sizeof(TAGBITS)))*/
100 /********************** SECTION HEADER **********************/
102 struct 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 */
118 #define SCNHDR struct external_scnhdr
122 * names of "special" sections
124 #define _TEXT ".text"
125 #define _DATA ".data"
128 /********************** LINE NUMBERS **********************/
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.
135 struct external_lineno
139 char l_symndx
[4]; /* function name symbol index, iff l_lnno == 0*/
140 char l_paddr
[4]; /* (physical) address of line number */
143 char l_lnno
[2]; /* line number */
144 char padding
[2]; /* force alignment */
148 #define LINENO struct external_lineno
151 /********************** SYMBOLS **********************/
153 #define E_SYMNMLEN 8 /* # characters in a symbol name */
154 #define E_FILNMLEN 14 /* # characters in a file name */
155 #define E_DIMNUM 4 /* # array dimensions in auxiliary entry */
157 struct external_syment
161 char e_name
[E_SYMNMLEN
];
179 #define N_BTMASK (0x1f)
180 #define N_TMASK (0x60)
184 union external_auxent
188 char x_tagndx
[4]; /* str, un, or enum tag indx */
194 char x_lnno
[2]; /* declaration line number */
195 char x_size
[2]; /* str/union/array size */
198 char x_fsize
[4]; /* size of function */
204 struct /* if ISFCN, tag, or .bb */
206 char x_lnnoptr
[4]; /* ptr to fcn line # */
207 char x_endndx
[4]; /* entry ndx past block end */
210 struct /* if ISARY, up to 4 dimen. */
212 char x_dimen
[E_DIMNUM
][2];
217 char x_tvndx
[2]; /* tv index */
223 char x_fname
[E_FILNMLEN
];
235 char x_scnlen
[4]; /* section length */
236 char x_nreloc
[2]; /* # relocation entries */
237 char x_nlinno
[2]; /* # line numbers */
243 char x_tvfill
[4]; /* tv fill value */
244 char x_tvlen
[2]; /* length of .tv */
245 char x_tvran
[2][2]; /* tv range */
247 } x_tv
; /* info about .tv section (in auxent of symbol .tv)) */
249 /******************************************
250 * I960-specific *2nd* aux. entry formats
251 ******************************************/
254 /* This is a very old typo that keeps getting propagated. */
255 #define x_stdindx x_stindx
256 char x_stindx
[4]; /* sys. table entry */
257 } x_sc
; /* system call entry */
261 char x_balntry
[4]; /* BAL entry point */
262 } x_bal
; /* BAL-callable function */
266 char x_timestamp
[4]; /* time stamp */
267 char x_idstring
[20]; /* producer identity string */
269 } x_ident
; /* Producer ident info */
272 #define SYMENT struct external_syment
274 #define AUXENT union external_auxent
277 # define _ETEXT "_etext"
279 /********************** RELOCATION DIRECTIVES **********************/
281 struct external_reloc
289 /* r_type values for the i960. */
291 /* The i960 uses R_RELLONG, which is defined in internal.h as 0x11.
292 It is an absolute 32 bit relocation. */
294 #define R_IPRMED (0x19) /* 24-bit ip-relative relocation */
295 #define R_OPTCALL (0x1b) /* 32-bit optimizable call (leafproc/sysproc) */
296 #define R_OPTCALLX (0x1c) /* 64-bit optimizable call (leafproc/sysproc) */
298 /* The following relocation types are defined use by relaxing linkers,
299 which convert 32 bit calls (which require a 64 bit instruction)
300 into 24 bit calls (which require a 32 bit instruction) when
301 possible. It will be possible whenever the target of the call is
302 within a 24 bit range of the call instruction.
304 It is always safe to ignore these relocations. They only serve to
305 mark points which the relaxing linker will have to consider. The
306 assembler must ensure that the correct code is generated even if
307 the relocations are ignored. In particular, this means that the
308 R_IPR13 relocation may not appear with an external symbol. */
310 #define R_IPR13 (0x1d) /* 13 bit ip-relative branch */
311 #define R_ALIGN (0x1e) /* alignment marker. This has no
312 associated symbol. Instead, the
313 r_symndx field indicates the
314 require alignment at this point in
315 the file. It must be a power of 2. */
317 #define RELOC struct external_reloc
This page took 0.035234 seconds and 4 git commands to generate.