]>
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 DHW |
20 | |
21 | /* $Id$ */ | |
22 | ||
4a81b561 DHW |
23 | /* Object file tdata; access macros */ |
24 | ||
25 | #define obj_icof(bfd) ((struct icofdata *) ((bfd)->tdata)) | |
9872a49c | 26 | #define coff_data(bfd) ((struct icofdata *) ((bfd)->tdata)) |
4a81b561 DHW |
27 | #define exec_hdr(bfd) (obj_icof(bfd)->hdr) |
28 | #define obj_symbols(bfd) (obj_icof(bfd)->symbols) | |
29 | #define obj_sym_filepos(bfd) (obj_icof(bfd)->sym_filepos) | |
30 | ||
31 | #define obj_relocbase(bfd) (obj_icof(bfd)->relocbase) | |
32 | #define obj_raw_syments(bfd) (obj_icof(bfd)->raw_syments) | |
33 | #define obj_convert(bfd) (obj_icof(bfd)->conversion_table) | |
e5b919b1 | 34 | #if CFILE_STUFF |
4a81b561 | 35 | #define obj_symbol_slew(bfd) (obj_icof(bfd)->symbol_index_slew) |
e5b919b1 SC |
36 | #else |
37 | #define obj_symbol_slew(bfd) 0 | |
38 | #endif | |
4a81b561 DHW |
39 | #define obj_string_table(bfd) (obj_icof(bfd)->string_table) |
40 | ||
3c8a3c56 JG |
41 | #if 0 |
42 | typedef struct coff_ptr_struct | |
43 | { | |
44 | unsigned int offset; | |
45 | char fix_tag; | |
46 | char fix_end; | |
47 | union { | |
48 | union internal_auxent auxent; | |
49 | struct internal_syment syment; | |
50 | } u; | |
51 | } combined_entry_type; | |
52 | ||
53 | ||
54 | typedef struct | |
55 | { | |
4a81b561 | 56 | asymbol symbol; |
3c8a3c56 | 57 | combined_entry_type *native; |
4a81b561 DHW |
58 | struct lineno_cache_entry *lineno; |
59 | } coff_symbol_type; | |
3c8a3c56 | 60 | #endif |
4a81b561 | 61 | |
9872a49c SC |
62 | typedef struct icofdata |
63 | { | |
3c8a3c56 JG |
64 | |
65 | struct coff_symbol_struct *symbols; /* symtab for input bfd */ | |
4a81b561 DHW |
66 | unsigned int *conversion_table; |
67 | file_ptr sym_filepos; | |
68 | ||
69 | long symbol_index_slew; /* used during read to mark whether a | |
70 | C_FILE symbol as been added. */ | |
71 | ||
3c8a3c56 | 72 | struct coff_ptr_struct *raw_syments; |
4a81b561 DHW |
73 | struct lineno *raw_linenos; |
74 | unsigned int raw_syment_count; | |
75 | char *string_table; | |
9872a49c | 76 | unsigned short flags; |
4a81b561 DHW |
77 | /* These are only valid once writing has begun */ |
78 | long int relocbase; | |
9872a49c | 79 | } coff_data_type; |
4a81b561 | 80 | |
fc723380 | 81 | /* We take the address of the first element of a asymbol to ensure that the |
4a81b561 DHW |
82 | * macro is only ever applied to an asymbol. */ |
83 | #define coffsymbol(asymbol) ((coff_symbol_type *)(&((asymbol)->the_bfd))) | |
fc723380 JG |
84 | |
85 | ||
3c8a3c56 | 86 | |
c618de01 | 87 | /*THE FOLLOWING IS EXTRACTED FROM THE SOURCE*/ |
3c8a3c56 | 88 | |
c618de01 SC |
89 | /* FROM coffcode.h*/ |
90 | /* ------------------------------START FROM coffcode.h | |
3c8a3c56 | 91 | |
c618de01 | 92 | The hidden information for an asymbol is: |
3c8a3c56 | 93 | */ |
c618de01 | 94 | |
3c8a3c56 JG |
95 | typedef struct coff_ptr_struct |
96 | { | |
97 | ||
c618de01 SC |
98 | /* |
99 | Remembers the offset from the first symbol in the file for this | |
100 | symbol. Generated by @code{coff_renumber_symbols}. | |
101 | */ | |
102 | ||
3c8a3c56 JG |
103 | unsigned int offset; |
104 | ||
c618de01 SC |
105 | /* |
106 | Should the tag field of this symbol be renumbered. | |
107 | Created by @code{coff_pointerize_aux}. | |
108 | */ | |
109 | ||
3c8a3c56 JG |
110 | char fix_tag; |
111 | ||
c618de01 SC |
112 | /* |
113 | Should the endidx field of this symbol be renumbered. | |
114 | Created by @code{coff_pointerize_aux}. | |
115 | */ | |
116 | ||
3c8a3c56 JG |
117 | char fix_end; |
118 | ||
c618de01 SC |
119 | /* |
120 | The container for the symbol structure as read and translated from the file. | |
121 | */ | |
122 | ||
3c8a3c56 JG |
123 | union { |
124 | union internal_auxent auxent; | |
125 | struct internal_syment syment; | |
126 | } u; | |
127 | } combined_entry_type; | |
128 | ||
c618de01 | 129 | /* |
3c8a3c56 | 130 | |
c618de01 | 131 | Each canonical asymbol really looks like this: |
3c8a3c56 | 132 | */ |
c618de01 | 133 | |
3c8a3c56 JG |
134 | typedef struct coff_symbol_struct |
135 | { | |
136 | ||
c618de01 | 137 | /* |
6724ff46 | 138 | The actual symbol which the rest of BFD works with |
c618de01 SC |
139 | */ |
140 | ||
3c8a3c56 JG |
141 | asymbol symbol; |
142 | ||
c618de01 SC |
143 | /* |
144 | A pointer to the hidden information for this symbol | |
145 | */ | |
146 | ||
3c8a3c56 JG |
147 | combined_entry_type *native; |
148 | ||
c618de01 SC |
149 | /* |
150 | A pointer to the linenumber information for this symbol | |
151 | */ | |
152 | ||
3c8a3c56 JG |
153 | struct lineno_cache_entry *lineno; |
154 | } coff_symbol_type; | |
c618de01 SC |
155 | |
156 | /* | |
157 | ||
158 | --------------------------------END FROM coffcode.h*/ | |
159 | ||
160 | ||
161 |