Commit | Line | Data |
---|---|---|
252b5132 | 1 | /* IEEE-695 object file formats: definitions internal to BFD. |
aa820537 | 2 | Copyright 1990, 1991, 1992, 1994, 1996, 2001, 2002, 2005, 2007 |
47fda0d3 | 3 | Free Software Foundation, Inc. |
252b5132 RH |
4 | Written by Cygnus Support. Mostly Steve Chamberlain's fault. |
5 | ||
cd123cb7 | 6 | This file is part of BFD, the Binary File Descriptor library. |
252b5132 | 7 | |
cd123cb7 NC |
8 | This program is free software; you can redistribute it and/or modify |
9 | it under the terms of the GNU General Public License as published by | |
10 | the Free Software Foundation; either version 3 of the License, or | |
11 | (at your option) any later version. | |
252b5132 | 12 | |
cd123cb7 NC |
13 | This program is distributed in the hope that it will be useful, |
14 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
16 | GNU General Public License for more details. | |
252b5132 | 17 | |
cd123cb7 NC |
18 | You should have received a copy of the GNU General Public License |
19 | along with this program; if not, write to the Free Software | |
20 | Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, | |
21 | MA 02110-1301, USA. */ | |
252b5132 RH |
22 | |
23 | typedef struct { | |
24 | unsigned int index:24; | |
25 | char letter; | |
26 | } ieee_symbol_index_type; | |
27 | ||
28 | typedef struct ct { | |
29 | bfd *this; | |
30 | struct ct *next; | |
31 | } bfd_chain_type; | |
32 | ||
dc810e39 | 33 | typedef struct ieee_symbol |
252b5132 RH |
34 | { |
35 | asymbol symbol; | |
36 | struct ieee_symbol *next; | |
37 | ||
38 | unsigned int index; | |
39 | } ieee_symbol_type; | |
40 | ||
41 | ||
42 | typedef struct ieee_reloc { | |
43 | arelent relent; | |
44 | struct ieee_reloc *next; | |
45 | ieee_symbol_index_type symbol; | |
46 | ||
47 | } ieee_reloc_type; | |
48 | ||
49 | #define ieee_symbol(x) ((ieee_symbol_type *)(x)) | |
50 | ||
51 | typedef struct ieee_per_section | |
52 | { | |
53 | asection *section; | |
54 | bfd_byte *data; | |
55 | bfd_vma offset; | |
56 | bfd_vma pc; | |
57 | /* For output */ | |
58 | file_ptr current_pos; | |
59 | unsigned int current_byte; | |
b34976b6 | 60 | bfd_boolean initialized; |
252b5132 RH |
61 | ieee_reloc_type **reloc_tail_ptr; |
62 | } ieee_per_section_type; | |
63 | ||
64 | #define ieee_per_section(x) ((ieee_per_section_type *)((x)->used_by_bfd)) | |
dc810e39 | 65 | |
252b5132 | 66 | typedef struct { |
47fda0d3 | 67 | unsigned char *input_p; |
252b5132 | 68 | unsigned char *first_byte; |
47fda0d3 | 69 | unsigned char *last_byte; |
252b5132 RH |
70 | bfd *abfd; |
71 | } common_header_type ; | |
72 | ||
73 | typedef struct ieee_data_struct | |
74 | { | |
75 | common_header_type h; | |
b34976b6 AM |
76 | bfd_boolean read_symbols; |
77 | bfd_boolean read_data; | |
252b5132 RH |
78 | file_ptr output_cursor; |
79 | /* Map of section indexes to section ptrs */ | |
80 | asection **section_table; | |
81 | unsigned int section_table_size; | |
82 | ieee_address_descriptor_type ad; | |
83 | ieee_module_begin_type mb; | |
84 | ieee_w_variable_type w; | |
dc810e39 | 85 | |
252b5132 | 86 | unsigned int section_count; |
dc810e39 | 87 | |
252b5132 RH |
88 | unsigned int map_idx; |
89 | /* List of GLOBAL EXPORT symbols */ | |
90 | ieee_symbol_type *external_symbols; | |
91 | /* List of UNDEFINED symbols */ | |
92 | ieee_symbol_type *external_reference; | |
dc810e39 | 93 | |
252b5132 RH |
94 | /* When the symbols have been canonicalized, they are in a |
95 | * special order, we remember various bases here.. */ | |
96 | unsigned int external_symbol_max_index; | |
97 | unsigned int external_symbol_min_index; | |
98 | unsigned int external_symbol_count; | |
99 | int external_symbol_base_offset; | |
dc810e39 | 100 | |
252b5132 RH |
101 | unsigned int external_reference_max_index; |
102 | unsigned int external_reference_min_index; | |
103 | unsigned int external_reference_count; | |
104 | int external_reference_base_offset; | |
dc810e39 | 105 | |
252b5132 | 106 | |
b34976b6 | 107 | bfd_boolean symbol_table_full; |
252b5132 | 108 | |
dc810e39 | 109 | |
b34976b6 | 110 | bfd_boolean done_debug; |
252b5132 RH |
111 | |
112 | ||
113 | bfd_chain_type *chain_head; | |
114 | bfd_chain_type *chain_root; | |
115 | ||
116 | } ieee_data_type; | |
117 | ||
118 | typedef struct { | |
119 | file_ptr file_offset; | |
120 | bfd *abfd; | |
121 | } ieee_ar_obstack_type; | |
122 | ||
dc810e39 | 123 | typedef struct ieee_ar_data_struct |
252b5132 RH |
124 | { |
125 | common_header_type h; | |
126 | ieee_ar_obstack_type *elements; | |
dc810e39 | 127 | |
252b5132 RH |
128 | unsigned int element_index ; |
129 | unsigned int element_count; | |
130 | ||
131 | } ieee_ar_data_type; | |
132 | ||
133 | #define IEEE_DATA(abfd) ((abfd)->tdata.ieee_data) | |
134 | #define IEEE_AR_DATA(abfd) ((abfd)->tdata.ieee_ar_data) | |
135 | ||
136 | #define ptr(abfd) (ieee_data(abfd)->input_p) |