]>
Commit | Line | Data |
---|---|---|
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 | 5 | This file is part of BFD, the Binary File Descriptor library. |
4a81b561 | 6 | |
3c8a3c56 | 7 | This program is free software; you can redistribute it and/or modify |
4a81b561 | 8 | it under the terms of the GNU General Public License as published by |
3c8a3c56 JG |
9 | the Free Software Foundation; either version 2 of the License, or |
10 | (at your option) any later version. | |
4a81b561 | 11 | |
3c8a3c56 | 12 | This program is distributed in the hope that it will be useful, |
4a81b561 DHW |
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. | |
16 | ||
17 | You should have received a copy of the GNU General Public License | |
3c8a3c56 JG |
18 | along with this program; if not, write to the Free Software |
19 | Foundation, 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) | |
3c8a3c56 | 32 | |
4a81b561 | 33 | |
3b4f1a5d | 34 | /* `Tdata' information kept for COFF files. */ |
3c8a3c56 | 35 | |
3b4f1a5d SC |
36 | typedef struct coff_tdata |
37 | { | |
38 | struct coff_symbol_struct *symbols; /* symtab for input bfd */ | |
4a81b561 DHW |
39 | unsigned int *conversion_table; |
40 | file_ptr sym_filepos; | |
41 | ||
42 | long symbol_index_slew; /* used during read to mark whether a | |
43 | C_FILE symbol as been added. */ | |
44 | ||
3b4f1a5d | 45 | struct coff_ptr_struct *raw_syments; |
4a81b561 DHW |
46 | struct lineno *raw_linenos; |
47 | unsigned int raw_syment_count; | |
9872a49c | 48 | unsigned short flags; |
3b4f1a5d | 49 | |
4a81b561 DHW |
50 | /* These are only valid once writing has begun */ |
51 | long int relocbase; | |
3b4f1a5d SC |
52 | |
53 | /* These members communicate important constants about the symbol table | |
54 | to GDB's symbol-reading code. These `constants' unfortunately vary | |
55 | from coff implementation to implementation... */ | |
56 | unsigned local_n_btmask; | |
57 | unsigned local_n_btshft; | |
58 | unsigned local_n_tmask; | |
59 | unsigned local_n_tshift; | |
60 | unsigned local_symesz; | |
61 | unsigned local_auxesz; | |
62 | unsigned local_linesz; | |
9872a49c | 63 | } coff_data_type; |
4a81b561 | 64 | |
fc723380 | 65 | /* We take the address of the first element of a asymbol to ensure that the |
4a81b561 DHW |
66 | * macro is only ever applied to an asymbol. */ |
67 | #define coffsymbol(asymbol) ((coff_symbol_type *)(&((asymbol)->the_bfd))) | |
fc723380 JG |
68 | |
69 | ||
3c8a3c56 | 70 | |
c618de01 | 71 | /*THE FOLLOWING IS EXTRACTED FROM THE SOURCE*/ |
3c8a3c56 | 72 | |
3b4f1a5d | 73 | /*:coffcode.h*/ |
3c8a3c56 | 74 | |
3b4f1a5d | 75 | /* |
c618de01 | 76 | The hidden information for an asymbol is: |
3c8a3c56 | 77 | */ |
c618de01 | 78 | |
3c8a3c56 JG |
79 | typedef struct coff_ptr_struct |
80 | { | |
81 | ||
c618de01 SC |
82 | /* |
83 | Remembers the offset from the first symbol in the file for this | |
84 | symbol. Generated by @code{coff_renumber_symbols}. | |
85 | */ | |
86 | ||
3c8a3c56 JG |
87 | unsigned int offset; |
88 | ||
c618de01 SC |
89 | /* |
90 | Should the tag field of this symbol be renumbered. | |
91 | Created by @code{coff_pointerize_aux}. | |
92 | */ | |
93 | ||
3c8a3c56 JG |
94 | char fix_tag; |
95 | ||
c618de01 SC |
96 | /* |
97 | Should the endidx field of this symbol be renumbered. | |
98 | Created by @code{coff_pointerize_aux}. | |
99 | */ | |
100 | ||
3c8a3c56 JG |
101 | char fix_end; |
102 | ||
c618de01 SC |
103 | /* |
104 | The container for the symbol structure as read and translated from the file. | |
105 | */ | |
106 | ||
3c8a3c56 JG |
107 | union { |
108 | union internal_auxent auxent; | |
109 | struct internal_syment syment; | |
110 | } u; | |
111 | } combined_entry_type; | |
112 | ||
c618de01 | 113 | /* |
3c8a3c56 | 114 | |
c618de01 | 115 | Each canonical asymbol really looks like this: |
3c8a3c56 | 116 | */ |
c618de01 | 117 | |
3c8a3c56 JG |
118 | typedef struct coff_symbol_struct |
119 | { | |
120 | ||
c618de01 | 121 | /* |
6724ff46 | 122 | The actual symbol which the rest of BFD works with |
c618de01 SC |
123 | */ |
124 | ||
3c8a3c56 JG |
125 | asymbol symbol; |
126 | ||
c618de01 SC |
127 | /* |
128 | A pointer to the hidden information for this symbol | |
129 | */ | |
130 | ||
3c8a3c56 JG |
131 | combined_entry_type *native; |
132 | ||
c618de01 SC |
133 | /* |
134 | A pointer to the linenumber information for this symbol | |
135 | */ | |
136 | ||
3c8a3c56 JG |
137 | struct lineno_cache_entry *lineno; |
138 | } coff_symbol_type; | |
c618de01 SC |
139 | |
140 | /* | |
3b4f1a5d | 141 | */ |
c618de01 SC |
142 | |
143 |