* trad-core.c, bfd.c, ../include/bfd.h: Various fixes for PMAX
[deliverable/binutils-gdb.git] / bfd / libcoff.h
CommitLineData
3c8a3c56
JG
1/* BFD COFF object file private structure.
2 Copyright (C) 1990-1991 Free Software Foundation, Inc.
3 Written by Cygnus Support.
4a81b561 4
3c8a3c56 5This file is part of BFD, the Binary File Descriptor library.
4a81b561 6
3c8a3c56 7This program is free software; you can redistribute it and/or modify
4a81b561 8it under the terms of the GNU General Public License as published by
3c8a3c56
JG
9the Free Software Foundation; either version 2 of the License, or
10(at your option) any later version.
4a81b561 11
3c8a3c56 12This program is distributed in the hope that it will be useful,
4a81b561
DHW
13but WITHOUT ANY WARRANTY; without even the implied warranty of
14MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15GNU General Public License for more details.
16
17You should have received a copy of the GNU General Public License
3c8a3c56
JG
18along with this program; if not, write to the Free Software
19Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
4a81b561 20
4a81b561 21
4a81b561
DHW
22/* Object file tdata; access macros */
23
3b4f1a5d
SC
24#define coff_data(bfd) ((coff_data_type *) ((bfd)->tdata))
25#define exec_hdr(bfd) (coff_data(bfd)->hdr)
26#define obj_symbols(bfd) (coff_data(bfd)->symbols)
27#define obj_sym_filepos(bfd) (coff_data(bfd)->sym_filepos)
3c8a3c56 28
3b4f1a5d
SC
29#define obj_relocbase(bfd) (coff_data(bfd)->relocbase)
30#define obj_raw_syments(bfd) (coff_data(bfd)->raw_syments)
31#define obj_convert(bfd) (coff_data(bfd)->conversion_table)
0cda46cf
SC
32#if CFILE_STUFF
33#define obj_symbol_slew(bfd) (coff_data(bfd)->symbol_index_slew)
34#else
35#define obj_symbol_slew(bfd) 0
36#endif
37
4a81b561 38
3b4f1a5d 39/* `Tdata' information kept for COFF files. */
3c8a3c56 40
3b4f1a5d
SC
41typedef struct coff_tdata
42{
43 struct coff_symbol_struct *symbols; /* symtab for input bfd */
4a81b561
DHW
44 unsigned int *conversion_table;
45 file_ptr sym_filepos;
46
47 long symbol_index_slew; /* used during read to mark whether a
48 C_FILE symbol as been added. */
49
3b4f1a5d 50 struct coff_ptr_struct *raw_syments;
4a81b561
DHW
51 struct lineno *raw_linenos;
52 unsigned int raw_syment_count;
9872a49c 53 unsigned short flags;
3b4f1a5d 54
4a81b561
DHW
55 /* These are only valid once writing has begun */
56 long int relocbase;
3b4f1a5d
SC
57
58 /* These members communicate important constants about the symbol table
59 to GDB's symbol-reading code. These `constants' unfortunately vary
60 from coff implementation to implementation... */
61 unsigned local_n_btmask;
62 unsigned local_n_btshft;
63 unsigned local_n_tmask;
64 unsigned local_n_tshift;
65 unsigned local_symesz;
66 unsigned local_auxesz;
67 unsigned local_linesz;
9872a49c 68} coff_data_type;
4a81b561 69
fc723380 70/* We take the address of the first element of a asymbol to ensure that the
4a81b561
DHW
71 * macro is only ever applied to an asymbol. */
72#define coffsymbol(asymbol) ((coff_symbol_type *)(&((asymbol)->the_bfd)))
fc723380
JG
73
74
3c8a3c56 75
616ebcfd 76/* And more taken from the source .. */
3c8a3c56 77
0cda46cf 78{
616ebcfd
SC
79
80 /* Remembers the offset from the first symbol in the file for
81 this symbol. Generated by coff_renumber_symbols. */
0cda46cf 82unsigned int offset;
616ebcfd
SC
83
84 /* Should the tag field of this symbol be renumbered.
85 Created by coff_pointerize_aux. */
0cda46cf 86char fix_tag;
616ebcfd
SC
87
88 /* Should the endidx field of this symbol be renumbered.
89 Created by coff_pointerize_aux. */
0cda46cf 90char fix_end;
616ebcfd
SC
91
92 /* The container for the symbol structure as read and translated
93 from the file. */
94
0cda46cf
SC
95union {
96 union internal_auxent auxent;
97 struct internal_syment syment;
98 } u;
99} combined_entry_type;
616ebcfd
SC
100
101
102 /* Each canonical asymbol really looks like this: */
103
0cda46cf
SC
104typedef struct coff_symbol_struct
105{
616ebcfd 106 /* The actual symbol which the rest of BFD works with */
0cda46cf 107asymbol symbol;
616ebcfd
SC
108
109 /* A pointer to the hidden information for this symbol */
0cda46cf 110combined_entry_type *native;
616ebcfd
SC
111
112 /* A pointer to the linenumber information for this symbol */
0cda46cf 113struct lineno_cache_entry *lineno;
c618de01 114
616ebcfd 115} coff_symbol_type;
This page took 0.046377 seconds and 4 git commands to generate.