1 /* coff information for 88k bcs
3 Copyright 2001, 2010 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 3 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,
18 MA 02110-1301, USA. */
20 #define DO_NOT_DEFINE_SCNHDR
22 #define DO_NOT_DEFINE_SYMENT
23 #define DO_NOT_DEFINE_AUXENT
24 #include "coff/external.h"
26 #define MC88MAGIC 0540 /* 88k BCS executable */
27 #define MC88DMAGIC 0541 /* DG/UX executable */
28 #define MC88OMAGIC 0555 /* Object file */
30 #define MC88BADMAG(x) (((x).f_magic != MC88MAGIC) \
31 && ((x).f_magic != MC88DMAGIC) \
32 && ((x).f_magic != MC88OMAGIC))
34 #define PAGEMAGIC3 0414 /* Split i&d, zero mapped */
35 #define PAGEMAGICBCS 0413
37 /********************** SECTION HEADER **********************/
39 struct external_scnhdr
41 char s_name
[8]; /* section name */
42 char s_paddr
[4]; /* physical address, aliased s_nlib */
43 char s_vaddr
[4]; /* virtual address */
44 char s_size
[4]; /* section size */
45 char s_scnptr
[4]; /* file ptr to raw data for section */
46 char s_relptr
[4]; /* file ptr to relocation */
47 char s_lnnoptr
[4]; /* file ptr to line numbers */
48 char s_nreloc
[4]; /* number of relocation entries */
49 char s_nlnno
[4]; /* number of line number entries*/
50 char s_flags
[4]; /* flags */
53 #define SCNHDR struct external_scnhdr
56 /* Names of "special" sections. */
60 #define _COMMENT ".comment"
63 /********************** SYMBOLS **********************/
65 #define E_SYMNMLEN 8 /* # characters in a symbol name */
66 #define E_FILNMLEN 14 /* # characters in a file name */
67 #define E_DIMNUM 4 /* # array dimensions in auxiliary entry */
69 struct external_syment
73 char e_name
[E_SYMNMLEN
];
96 /* Note that this isn't the same shape as other coffs */
101 char x_tagndx
[4]; /* str, un, or enum tag indx */
106 char x_fsize
[4]; /* size of function */
110 char x_lnno
[4]; /* declaration line number */
111 char x_size
[4]; /* str/union/array size */
119 struct /* if ISFCN, tag, or .bb */
121 char x_lnnoptr
[4]; /* ptr to fcn line # */
122 char x_endndx
[4]; /* entry ndx past block end */
125 struct /* if ISARY, up to 4 dimen. */
127 char x_dimen
[E_DIMNUM
][2];
137 char x_fname
[E_FILNMLEN
];
149 char x_scnlen
[4]; /* section length */
150 char x_nreloc
[4]; /* # relocation entries */
151 char x_nlinno
[4]; /* # line numbers */
156 char x_tvfill
[4]; /* tv fill value */
157 char x_tvlen
[2]; /* length of .tv */
158 char x_tvran
[2][2]; /* tv range */
159 } x_tv
; /* info about .tv section (in auxent of symbol .tv)) */
162 #define GET_LNSZ_SIZE(abfd, ext) \
163 H_GET_32 (abfd, ext->x_sym.x_misc.x_lnsz.x_size)
164 #define GET_LNSZ_LNNO(abfd, ext) \
165 H_GET_32 (abfd, ext->x_sym.x_misc.x_lnsz.x_lnno)
166 #define PUT_LNSZ_LNNO(abfd, in, ext) \
167 H_PUT_32 (abfd, in, ext->x_sym.x_misc.x_lnsz.x_lnno)
168 #define PUT_LNSZ_SIZE(abfd, in, ext) \
169 H_PUT_32 (abfd, in, ext->x_sym.x_misc.x_lnsz.x_size)
170 #define GET_SCN_NRELOC(abfd, ext) \
171 H_GET_32 (abfd, ext->x_scn.x_nreloc)
172 #define GET_SCN_NLINNO(abfd, ext) \
173 H_GET_32 (abfd, ext->x_scn.x_nlinno)
174 #define PUT_SCN_NRELOC(abfd, in, ext) \
175 H_PUT_32 (abfd, in, ext->x_scn.x_nreloc)
176 #define PUT_SCN_NLINNO(abfd, in, ext) \
177 H_PUT_32 (abfd,in, ext->x_scn.x_nlinno)
179 #define SYMENT struct external_syment
181 #define AUXENT union external_auxent
184 /********************** RELOCATION DIRECTIVES **********************/
186 struct external_reloc
194 #define RELOC struct external_reloc