1 /* `Extended (actually Mangled) COFF' symbol table external format.
2 Copyright 1992 Free Software Foundation.
3 Contributed by Cygnus Support. Written by John Gilmore.
5 This file is part of GDB.
7 This program is free software; you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation; either version 2 of the License, or
10 (at your option) any later version.
12 This program is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
17 You should have received a copy of the GNU General Public License
18 along with this program; if not, write to the Free Software
19 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
21 /* File header as a set of bytes */
28 char h_cbLineOffset[4];
34 char h_cbSymOffset[4];
36 char h_cbOptOffset[4];
38 char h_cbAuxOffset[4];
42 char h_cbSsExtOffset[4];
46 char h_cbRfdOffset[4];
48 char h_cbExtOffset[4];
51 /* File descriptor external record */
72 char f_cbLineOffset[4];
76 #define FDR_BITS1_LANG_BIG 0xF8
77 #define FDR_BITS1_LANG_SH_BIG 3
78 #define FDR_BITS1_LANG_LITTLE 0x1F
79 #define FDR_BITS1_LANG_SH_LITTLE 0
81 #define FDR_BITS1_FMERGE_BIG 0x04
82 #define FDR_BITS1_FMERGE_LITTLE 0x20
84 #define FDR_BITS1_FREADIN_BIG 0x02
85 #define FDR_BITS1_FREADIN_LITTLE 0x40
87 #define FDR_BITS1_FBIGENDIAN_BIG 0x01
88 #define FDR_BITS1_FBIGENDIAN_LITTLE 0x80
90 #define FDR_BITS2_GLEVEL_BIG 0xC0
91 #define FDR_BITS2_GLEVEL_SH_BIG 6
92 #define FDR_BITS2_GLEVEL_LITTLE 0x03
93 #define FDR_BITS2_GLEVEL_SH_LITTLE 0
95 /* We ignore the `reserved' field in bits2. */
98 /* Procedure descriptor external record */
108 char p_fregoffset[4];
109 char p_frameoffset[4];
114 char p_cbLineOffset[4];
123 /* Symbol external record */
134 #define SYM_BITS1_ST_BIG 0xFC
135 #define SYM_BITS1_ST_SH_BIG 2
136 #define SYM_BITS1_ST_LITTLE 0x3F
137 #define SYM_BITS1_ST_SH_LITTLE 0
139 #define SYM_BITS1_SC_BIG 0x03
140 #define SYM_BITS1_SC_SH_LEFT_BIG 3
141 #define SYM_BITS1_SC_LITTLE 0xC0
142 #define SYM_BITS1_SC_SH_LITTLE 6
144 #define SYM_BITS2_SC_BIG 0xE0
145 #define SYM_BITS2_SC_SH_BIG 5
146 #define SYM_BITS2_SC_LITTLE 0x07
147 #define SYM_BITS2_SC_SH_LEFT_LITTLE 2
149 #define SYM_BITS2_RESERVED_BIG 0x10
150 #define SYM_BITS2_RESERVED_LITTLE 0x08
152 #define SYM_BITS2_INDEX_BIG 0x0F
153 #define SYM_BITS2_INDEX_SH_LEFT_BIG 16
154 #define SYM_BITS2_INDEX_LITTLE 0xF0
155 #define SYM_BITS2_INDEX_SH_LITTLE 4
157 #define SYM_BITS3_INDEX_SH_LEFT_BIG 8
158 #define SYM_BITS3_INDEX_SH_LEFT_LITTLE 4
160 #define SYM_BITS4_INDEX_SH_LEFT_BIG 0
161 #define SYM_BITS4_INDEX_SH_LEFT_LITTLE 12
163 /* External symbol external record */
169 struct sym_ext es_asym;
172 #define EXT_BITS1_JMPTBL_BIG 0x80
173 #define EXT_BITS1_JMPTBL_LITTLE 0x01
175 #define EXT_BITS1_COBOL_MAIN_BIG 0x40
176 #define EXT_BITS1_COBOL_MAIN_LITTLE 0x02
178 /* Type information external record */
187 #define TIR_BITS1_FBITFIELD_BIG 0x80
188 #define TIR_BITS1_FBITFIELD_LITTLE 0x01
190 #define TIR_BITS1_CONTINUED_BIG 0x40
191 #define TIR_BITS1_CONTINUED_LITTLE 0x02
193 #define TIR_BITS1_BT_BIG 0x3F
194 #define TIR_BITS1_BT_SH_BIG 0
195 #define TIR_BITS1_BT_LITTLE 0xFC
196 #define TIR_BITS1_BT_SH_LITTLE 2
198 #define TIR_BITS_TQ4_BIG 0xF0
199 #define TIR_BITS_TQ4_SH_BIG 4
200 #define TIR_BITS_TQ5_BIG 0x0F
201 #define TIR_BITS_TQ5_SH_BIG 0
202 #define TIR_BITS_TQ4_LITTLE 0x0F
203 #define TIR_BITS_TQ4_SH_LITTLE 0
204 #define TIR_BITS_TQ5_LITTLE 0xF0
205 #define TIR_BITS_TQ5_SH_LITTLE 4
207 #define TIR_BITS_TQ0_BIG 0xF0
208 #define TIR_BITS_TQ0_SH_BIG 4
209 #define TIR_BITS_TQ1_BIG 0x0F
210 #define TIR_BITS_TQ1_SH_BIG 0
211 #define TIR_BITS_TQ0_LITTLE 0x0F
212 #define TIR_BITS_TQ0_SH_LITTLE 0
213 #define TIR_BITS_TQ1_LITTLE 0xF0
214 #define TIR_BITS_TQ1_SH_LITTLE 4
216 #define TIR_BITS_TQ2_BIG 0xF0
217 #define TIR_BITS_TQ2_SH_BIG 4
218 #define TIR_BITS_TQ3_BIG 0x0F
219 #define TIR_BITS_TQ3_SH_BIG 0
220 #define TIR_BITS_TQ2_LITTLE 0x0F
221 #define TIR_BITS_TQ2_SH_LITTLE 0
222 #define TIR_BITS_TQ3_LITTLE 0xF0
223 #define TIR_BITS_TQ3_SH_LITTLE 4
226 /* Relative symbol external record */
232 #define RNDX_BITS0_RFD_SH_LEFT_BIG 4
233 #define RNDX_BITS1_RFD_BIG 0xF0
234 #define RNDX_BITS1_RFD_SH_BIG 4
236 #define RNDX_BITS0_RFD_SH_LEFT_LITTLE 0
237 #define RNDX_BITS1_RFD_LITTLE 0x0F
238 #define RNDX_BITS1_RFD_SH_LEFT_LITTLE 8
240 #define RNDX_BITS1_INDEX_BIG 0x0F
241 #define RNDX_BITS1_INDEX_SH_LEFT_BIG 16
242 #define RNDX_BITS2_INDEX_SH_LEFT_BIG 8
243 #define RNDX_BITS3_INDEX_SH_LEFT_BIG 0
245 #define RNDX_BITS1_INDEX_LITTLE 0xF0
246 #define RNDX_BITS1_INDEX_SH_LITTLE 4
247 #define RNDX_BITS2_INDEX_SH_LEFT_LITTLE 4
248 #define RNDX_BITS3_INDEX_SH_LEFT_LITTLE 12
251 /* Dense numbers external record */
258 /* Auxliliary symbol information external record */
262 struct rndx_ext a_rndx;
271 /* FIXME! These are copied from ../bfd/libbfd.h */
272 PROTO (bfd_vma, _do_getb32, (unsigned char *addr));
273 PROTO (bfd_vma, _do_getl32, (unsigned char *addr));
275 #define AUX_GET_DNLOW(bigend, ax) (bigend? _do_getb32 ((ax)->a_dnLow): \
276 _do_getl32 ((ax)->a_dnLow))
277 #define AUX_GET_DNHIGH(bigend, ax) (bigend? _do_getb32 ((ax)->a_dnHigh): \
278 _do_getl32 ((ax)->a_dnHigh))
279 #define AUX_GET_ISYM(bigend, ax) (bigend? _do_getb32 ((ax)->a_isym): \
280 _do_getl32 ((ax)->a_isym))
281 #define AUX_GET_ISS(bigend, ax) (bigend? _do_getb32 ((ax)->a_iss): \
282 _do_getl32 ((ax)->a_iss))
283 #define AUX_GET_WIDTH(bigend, ax) (bigend? _do_getb32 ((ax)->a_width): \
284 _do_getl32 ((ax)->a_width))
285 #define AUX_GET_COUNT(bigend, ax) (bigend? _do_getb32 ((ax)->a_count): \
286 _do_getl32 ((ax)->a_count))
288 /* Relative file descriptor */