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
34 #define FILHSZ sizeof(FILHDR)
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 */
51 #define AOUTSZ (sizeof(AOUTHDR))
53 #define OMAGIC 0404 /* object files, eg as output */
54 #define ZMAGIC 0413 /* demand load format, eg normal ld output */
55 #define STMAGIC 0401 /* target shlib */
56 #define SHMAGIC 0443 /* host shlib */
58 /********************** SECTION HEADER **********************/
60 struct external_scnhdr
62 char s_name[8]; /* section name */
63 char s_paddr[4]; /* physical address, aliased s_nlib */
64 char s_vaddr[4]; /* virtual address */
65 char s_size[4]; /* section size */
66 char s_scnptr[4]; /* file ptr to raw data for section */
67 char s_relptr[4]; /* file ptr to relocation */
68 char s_lnnoptr[4]; /* file ptr to line numbers */
69 char s_nreloc[2]; /* number of relocation entries */
70 char s_nlnno[2]; /* number of line number entries*/
71 char s_flags[4]; /* flags */
74 #define SCNHDR struct external_scnhdr
75 #define SCNHSZ sizeof(SCNHDR)
77 /* Names of "special" sections. */
85 #define _COMMENT ".comment"
88 /********************** LINE NUMBERS **********************/
90 /* 1 line number entry for every "breakpointable" source line in a section.
91 Line numbers are grouped on a per function basis; first entry in a function
92 grouping will have l_lnno = 0 and in place of physical address will be the
93 symbol table index of the function name. */
95 struct external_lineno
98 char l_symndx[4]; /* fn name symbol index, iff l_lnno == 0 */
99 char l_paddr[4]; /* (physical) address of line number */
101 char l_lnno[2]; /* line number */
104 #define LINENO struct external_lineno
107 /********************** SYMBOLS **********************/
109 #define E_SYMNMLEN (8) /* # characters in a symbol name */
110 #define E_FILNMLEN (14) /* # characters in a file name */
111 #define E_DIMNUM (4) /* # array dimensions in auxiliary entry */
113 struct external_syment
116 char e_name[E_SYMNMLEN];
121 #if 0 /* of doubtful value */
124 char e_leading_zero[1];
139 #define N_BTMASK (0xf)
140 #define N_TMASK (0x30)
144 union external_auxent
147 char x_tagndx[4]; /* str, un, or enum tag indx */
150 char x_lnno[2]; /* declaration line number */
151 char x_size[2]; /* str/union/array size */
153 char x_fsize[4]; /* size of function */
156 struct { /* if ISFCN, tag, or .bb */
157 char x_lnnoptr[4]; /* ptr to fcn line # */
158 char x_endndx[4]; /* entry ndx past block end */
160 struct { /* if ISARY, up to 4 dimen. */
161 char x_dimen[E_DIMNUM][2];
164 char x_tvndx[2]; /* tv index */
168 char x_fname[E_FILNMLEN];
176 char x_scnlen[4]; /* section length */
177 char x_nreloc[2]; /* # relocation entries */
178 char x_nlinno[2]; /* # line numbers */
182 char x_tvfill[4]; /* tv fill value */
183 char x_tvlen[2]; /* length of .tv */
184 char x_tvran[2][2]; /* tv range */
185 } x_tv; /* .tv section info (in auxent of sym .tv)) */
187 char x_fill[20]; /* forces to 20-byte size */
190 #define SYMENT struct external_syment
192 #define AUXENT union external_auxent
195 #define _ETEXT "etext"
197 /********************** RELOCATION DIRECTIVES **********************/
199 struct external_reloc {
207 #define RELOC struct external_reloc
210 #define DEFAULT_DATA_SECTION_ALIGNMENT 4
211 #define DEFAULT_BSS_SECTION_ALIGNMENT 4
212 #define DEFAULT_TEXT_SECTION_ALIGNMENT 4
213 /* For new sections we havn't heard of before */
214 #define DEFAULT_SECTION_ALIGNMENT 4