1 /*** coff information for Sparc. */
3 /* This file is an amalgamation of several standard include files that
4 define coff format, such as filehdr.h, aouthdr.h, and so forth. In
5 addition, all datatypes have been translated into character arrays of
6 (presumed) equivalent size. This is necessary so that this file can
7 be used with different systems while still yielding the same results. */
9 /********************** FILE HEADER **********************/
11 struct external_filehdr
13 char f_magic
[2]; /* magic number */
14 char f_nscns
[2]; /* number of sections */
15 char f_timdat
[4]; /* time & date stamp */
16 char f_symptr
[4]; /* file pointer to symtab */
17 char f_nsyms
[4]; /* number of symtab entries */
18 char f_opthdr
[2]; /* sizeof(optional hdr) */
19 char f_flags
[2]; /* flags */
22 #define F_RELFLG (0x0001) /* relocation info stripped */
23 #define F_EXEC (0x0002) /* file is executable */
24 #define F_LNNO (0x0004) /* line numbers stripped */
25 #define F_LSYMS (0x0008) /* local symbols stripped */
27 #define SPARCMAGIC (0540)
29 /* This is Lynx's all-platform magic number for executables. */
31 #define LYNXCOFFMAGIC (0415)
33 #define FILHDR struct external_filehdr
36 /********************** AOUT "OPTIONAL HEADER" **********************/
40 char magic
[2]; /* type of file */
41 char vstamp
[2]; /* version stamp */
42 char tsize
[4]; /* text size in bytes, padded to FW bdry*/
43 char dsize
[4]; /* initialized data " " */
44 char bsize
[4]; /* uninitialized data " " */
45 char entry
[4]; /* entry pt. */
46 char text_start
[4]; /* base of text used for this file */
47 char data_start
[4]; /* base of data used for this file */
54 #define OMAGIC 0404 /* object files, eg as output */
55 #define ZMAGIC 0413 /* demand load format, eg normal ld output */
56 #define STMAGIC 0401 /* target shlib */
57 #define SHMAGIC 0443 /* host shlib */
59 /********************** SECTION HEADER **********************/
61 struct external_scnhdr
63 char s_name
[8]; /* section name */
64 char s_paddr
[4]; /* physical address, aliased s_nlib */
65 char s_vaddr
[4]; /* virtual address */
66 char s_size
[4]; /* section size */
67 char s_scnptr
[4]; /* file ptr to raw data for section */
68 char s_relptr
[4]; /* file ptr to relocation */
69 char s_lnnoptr
[4]; /* file ptr to line numbers */
70 char s_nreloc
[2]; /* number of relocation entries */
71 char s_nlnno
[2]; /* number of line number entries*/
72 char s_flags
[4]; /* flags */
75 #define SCNHDR struct external_scnhdr
78 /* Names of "special" sections. */
86 #define _COMMENT ".comment"
89 /********************** LINE NUMBERS **********************/
91 /* 1 line number entry for every "breakpointable" source line in a section.
92 Line numbers are grouped on a per function basis; first entry in a function
93 grouping will have l_lnno = 0 and in place of physical address will be the
94 symbol table index of the function name. */
96 struct external_lineno
99 char l_symndx
[4]; /* fn name symbol index, iff l_lnno == 0 */
100 char l_paddr
[4]; /* (physical) address of line number */
102 char l_lnno
[2]; /* line number */
105 #define LINENO struct external_lineno
108 /********************** SYMBOLS **********************/
110 #define E_SYMNMLEN (8) /* # characters in a symbol name */
111 #define E_FILNMLEN (14) /* # characters in a file name */
112 #define E_DIMNUM (4) /* # array dimensions in auxiliary entry */
114 struct external_syment
117 char e_name
[E_SYMNMLEN
];
122 #if 0 /* of doubtful value */
125 char e_leading_zero
[1];
140 #define N_BTMASK (0xf)
141 #define N_TMASK (0x30)
145 union external_auxent
148 char x_tagndx
[4]; /* str, un, or enum tag indx */
151 char x_lnno
[2]; /* declaration line number */
152 char x_size
[2]; /* str/union/array size */
154 char x_fsize
[4]; /* size of function */
157 struct { /* if ISFCN, tag, or .bb */
158 char x_lnnoptr
[4]; /* ptr to fcn line # */
159 char x_endndx
[4]; /* entry ndx past block end */
161 struct { /* if ISARY, up to 4 dimen. */
162 char x_dimen
[E_DIMNUM
][2];
165 char x_tvndx
[2]; /* tv index */
169 char x_fname
[E_FILNMLEN
];
177 char x_scnlen
[4]; /* section length */
178 char x_nreloc
[2]; /* # relocation entries */
179 char x_nlinno
[2]; /* # line numbers */
183 char x_tvfill
[4]; /* tv fill value */
184 char x_tvlen
[2]; /* length of .tv */
185 char x_tvran
[2][2]; /* tv range */
186 } x_tv
; /* .tv section info (in auxent of sym .tv)) */
188 char x_fill
[20]; /* forces to 20-byte size */
191 #define SYMENT struct external_syment
193 #define AUXENT union external_auxent
196 #define _ETEXT "etext"
198 /********************** RELOCATION DIRECTIVES **********************/
200 struct external_reloc
{
208 #define RELOC struct external_reloc