Commit | Line | Data |
---|---|---|
252b5132 | 1 | /* Target definitions for 32/64-bit NLM (NetWare Loadable Module) |
7920ce38 | 2 | Copyright 1993, 1994, 1998, 1999, 2000, 2001, 2002, 2003, 2004, |
157090f7 | 3 | 2005, 2007 Free Software Foundation, Inc. |
252b5132 | 4 | |
7920ce38 | 5 | This file is part of BFD, the Binary File Descriptor library. |
252b5132 | 6 | |
7920ce38 NC |
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 | |
cd123cb7 | 9 | the Free Software Foundation; either version 3 of the License, or |
7920ce38 | 10 | (at your option) any later version. |
252b5132 | 11 | |
7920ce38 NC |
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. | |
252b5132 | 16 | |
7920ce38 NC |
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 | |
cd123cb7 NC |
19 | Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, |
20 | MA 02110-1301, USA. */ | |
252b5132 RH |
21 | |
22 | #define nlm_core_file_p _bfd_dummy_target | |
23 | ||
7920ce38 NC |
24 | #define nlm_get_symtab_upper_bound nlmNAME (get_symtab_upper_bound) |
25 | #define nlm_canonicalize_symtab nlmNAME (canonicalize_symtab) | |
26 | #define nlm_make_empty_symbol nlmNAME (make_empty_symbol) | |
27 | #define nlm_print_symbol nlmNAME (print_symbol) | |
28 | #define nlm_get_symbol_info nlmNAME (get_symbol_info) | |
29 | #define nlm_bfd_is_local_label_name bfd_generic_is_local_label_name | |
30 | #define nlm_bfd_is_target_special_symbol ((bfd_boolean (*) (bfd *, asymbol *)) bfd_false) | |
31 | #define nlm_get_lineno _bfd_nosymbols_get_lineno | |
32 | #define nlm_find_nearest_line _bfd_nosymbols_find_nearest_line | |
4ab527b0 | 33 | #define nlm_find_inliner_info _bfd_nosymbols_find_inliner_info |
7920ce38 NC |
34 | #define nlm_bfd_make_debug_symbol _bfd_nosymbols_bfd_make_debug_symbol |
35 | #define nlm_read_minisymbols _bfd_generic_read_minisymbols | |
36 | #define nlm_minisymbol_to_symbol _bfd_generic_minisymbol_to_symbol | |
37 | ||
38 | #define nlm_get_reloc_upper_bound nlmNAME (get_reloc_upper_bound) | |
39 | #define nlm_canonicalize_reloc nlmNAME (canonicalize_reloc) | |
40 | #define nlm_bfd_reloc_type_lookup bfd_default_reloc_type_lookup | |
157090f7 | 41 | #define nlm_bfd_reloc_name_lookup _bfd_norelocs_bfd_reloc_name_lookup |
7920ce38 NC |
42 | #define nlm_set_section_contents nlmNAME (set_section_contents) |
43 | ||
44 | #define nlm_sizeof_headers _bfd_nolink_sizeof_headers | |
45 | #define nlm_bfd_get_relocated_section_contents bfd_generic_get_relocated_section_contents | |
46 | #define nlm_bfd_relax_section bfd_generic_relax_section | |
47 | #define nlm_bfd_gc_sections bfd_generic_gc_sections | |
48 | #define nlm_bfd_merge_sections bfd_generic_merge_sections | |
49 | #define nlm_bfd_is_group_section bfd_generic_is_group_section | |
50 | #define nlm_bfd_discard_group bfd_generic_discard_group | |
51 | #define nlm_section_already_linked _bfd_generic_section_already_linked | |
52 | #define nlm_bfd_link_hash_table_create _bfd_generic_link_hash_table_create | |
53 | #define nlm_bfd_link_hash_table_free _bfd_generic_link_hash_table_free | |
54 | #define nlm_bfd_link_add_symbols _bfd_generic_link_add_symbols | |
55 | #define nlm_bfd_link_just_syms _bfd_generic_link_just_syms | |
56 | #define nlm_bfd_final_link _bfd_generic_final_link | |
57 | #define nlm_bfd_link_split_section _bfd_generic_link_split_section | |
252b5132 RH |
58 | |
59 | /* This structure contains everything that BFD knows about a target. | |
60 | It includes things like its byte order, name, what routines to call | |
61 | to do various operations, etc. Every BFD points to a target structure | |
62 | with its "xvec" member. | |
63 | ||
64 | There are two such structures here: one for big-endian machines and | |
65 | one for little-endian machines. */ | |
66 | ||
c3c89269 NC |
67 | /* Forward declaration for use when initialising alternative_target field. */ |
68 | #ifdef TARGET_LITTLE_SYM | |
69 | extern const bfd_target TARGET_LITTLE_SYM; | |
70 | #endif | |
252b5132 RH |
71 | |
72 | #ifdef TARGET_BIG_SYM | |
73 | const bfd_target TARGET_BIG_SYM = | |
74 | { | |
7920ce38 | 75 | /* Name: identify kind of target. */ |
252b5132 RH |
76 | TARGET_BIG_NAME, |
77 | ||
7920ce38 | 78 | /* Flavour: general indication about file. */ |
252b5132 RH |
79 | bfd_target_nlm_flavour, |
80 | ||
7920ce38 | 81 | /* Byteorder: data is big endian. */ |
252b5132 RH |
82 | BFD_ENDIAN_BIG, |
83 | ||
7920ce38 | 84 | /* Header_byteorder: header is also big endian. */ |
252b5132 RH |
85 | BFD_ENDIAN_BIG, |
86 | ||
7920ce38 | 87 | /* Object_flags: mask of all file flags. */ |
252b5132 RH |
88 | (HAS_RELOC | EXEC_P | HAS_LINENO | HAS_DEBUG | HAS_SYMS | HAS_LOCALS |
89 | | WP_TEXT), | |
1518639e | 90 | |
7920ce38 NC |
91 | /* Section_flags: mask of all section flags. */ |
92 | (SEC_HAS_CONTENTS | SEC_ALLOC | SEC_LOAD | SEC_RELOC | SEC_READONLY | |
93 | | SEC_CODE | SEC_DATA), | |
252b5132 | 94 | |
7920ce38 NC |
95 | /* Leading_symbol_char: is the first char of a user symbol |
96 | predictable, and if so what is it. */ | |
252b5132 RH |
97 | 0, |
98 | ||
7920ce38 | 99 | /* AR_pad_char: pad character for filenames within an archive header |
252b5132 | 100 | FIXME: this really has nothing to do with NLM, this is a characteristic |
7920ce38 | 101 | of the archiver and/or os and should be independently tunable. */ |
252b5132 RH |
102 | '/', |
103 | ||
7920ce38 | 104 | /* AR_max_namelen: maximum number of characters in an archive header |
252b5132 RH |
105 | FIXME: this really has nothing to do with NLM, this is a characteristic |
106 | of the archiver and should be independently tunable. This value is | |
7920ce38 | 107 | a WAG (wild a** guess). */ |
252b5132 RH |
108 | 15, |
109 | ||
7920ce38 | 110 | /* Routines to byte-swap various sized integers from the data sections. */ |
252b5132 | 111 | bfd_getb64, bfd_getb_signed_64, bfd_putb64, |
7920ce38 NC |
112 | bfd_getb32, bfd_getb_signed_32, bfd_putb32, |
113 | bfd_getb16, bfd_getb_signed_16, bfd_putb16, | |
252b5132 | 114 | |
7920ce38 | 115 | /* Routines to byte-swap various sized integers from the file headers. */ |
252b5132 | 116 | bfd_getb64, bfd_getb_signed_64, bfd_putb64, |
7920ce38 NC |
117 | bfd_getb32, bfd_getb_signed_32, bfd_putb32, |
118 | bfd_getb16, bfd_getb_signed_16, bfd_putb16, | |
119 | ||
120 | /* bfd_check_format: check the format of a file being read. */ | |
121 | { _bfd_dummy_target, /* Unknown format. */ | |
122 | nlmNAME (object_p), /* Assembler/linker output (object file). */ | |
123 | bfd_generic_archive_p, /* An archive. */ | |
124 | nlm_core_file_p /* A core file. */ | |
252b5132 RH |
125 | }, |
126 | ||
7920ce38 | 127 | /* bfd_set_format: set the format of a file being written. */ |
252b5132 RH |
128 | { bfd_false, |
129 | nlm_mkobject, | |
130 | _bfd_generic_mkarchive, | |
131 | bfd_false | |
132 | }, | |
133 | ||
7920ce38 | 134 | /* bfd_write_contents: write cached information into a file being written. */ |
252b5132 | 135 | { bfd_false, |
7920ce38 | 136 | nlmNAME (write_object_contents), |
252b5132 RH |
137 | _bfd_write_archive_contents, |
138 | bfd_false | |
139 | }, | |
140 | ||
7920ce38 NC |
141 | /* Initialize a jump table with the standard macro. |
142 | All names start with "nlm". */ | |
252b5132 RH |
143 | BFD_JUMP_TABLE_GENERIC (_bfd_generic), |
144 | BFD_JUMP_TABLE_COPY (_bfd_generic), | |
145 | BFD_JUMP_TABLE_CORE (_bfd_nocore), | |
146 | BFD_JUMP_TABLE_ARCHIVE (_bfd_noarchive), | |
147 | BFD_JUMP_TABLE_SYMBOLS (nlm), | |
148 | BFD_JUMP_TABLE_RELOCS (nlm), | |
149 | BFD_JUMP_TABLE_WRITE (nlm), | |
150 | BFD_JUMP_TABLE_LINK (nlm), | |
151 | BFD_JUMP_TABLE_DYNAMIC (_bfd_nodynamic), | |
152 | ||
c3c89269 NC |
153 | /* Alternative endian target. */ |
154 | #ifdef TARGET_LITTLE_SYM | |
155 | & TARGET_LITTLE_SYM, | |
156 | #else | |
157 | NULL, | |
158 | #endif | |
1518639e | 159 | |
7920ce38 NC |
160 | /* Backend_data. */ |
161 | (void *) TARGET_BACKEND_DATA | |
252b5132 RH |
162 | }; |
163 | #endif | |
164 | ||
165 | #ifdef TARGET_LITTLE_SYM | |
166 | const bfd_target TARGET_LITTLE_SYM = | |
167 | { | |
7920ce38 | 168 | /* Name: identify kind of target. */ |
252b5132 RH |
169 | TARGET_LITTLE_NAME, |
170 | ||
7920ce38 | 171 | /* Flavour: general indication about file. */ |
252b5132 RH |
172 | bfd_target_nlm_flavour, |
173 | ||
7920ce38 | 174 | /* Byteorder: data is little endian. */ |
252b5132 RH |
175 | BFD_ENDIAN_LITTLE, |
176 | ||
7920ce38 | 177 | /* Header_byteorder: header is also little endian. */ |
252b5132 RH |
178 | BFD_ENDIAN_LITTLE, |
179 | ||
7920ce38 | 180 | /* Object_flags: mask of all file flags. */ |
252b5132 RH |
181 | (HAS_RELOC | EXEC_P | HAS_LINENO | HAS_DEBUG | HAS_SYMS | HAS_LOCALS |
182 | | WP_TEXT), | |
1518639e | 183 | |
7920ce38 NC |
184 | /* Section_flags: mask of all section flags. */ |
185 | (SEC_HAS_CONTENTS | SEC_ALLOC | SEC_LOAD | SEC_RELOC | SEC_READONLY | |
186 | | SEC_DATA), | |
252b5132 | 187 | |
7920ce38 NC |
188 | /* Leading_symbol_char: is the first char of a user symbol |
189 | predictable, and if so what is it. */ | |
252b5132 RH |
190 | 0, |
191 | ||
7920ce38 | 192 | /* AR_pad_char: pad character for filenames within an archive header |
252b5132 | 193 | FIXME: this really has nothing to do with NLM, this is a characteristic |
7920ce38 | 194 | of the archiver and/or os and should be independently tunable. */ |
252b5132 RH |
195 | '/', |
196 | ||
7920ce38 | 197 | /* AR_max_namelen: maximum number of characters in an archive header |
252b5132 RH |
198 | FIXME: this really has nothing to do with NLM, this is a characteristic |
199 | of the archiver and should be independently tunable. This value is | |
7920ce38 | 200 | a WAG (wild a** guess). */ |
252b5132 RH |
201 | 15, |
202 | ||
7920ce38 | 203 | /* Routines to byte-swap various sized integers from the data sections. */ |
252b5132 | 204 | bfd_getl64, bfd_getl_signed_64, bfd_putl64, |
7920ce38 NC |
205 | bfd_getl32, bfd_getl_signed_32, bfd_putl32, |
206 | bfd_getl16, bfd_getl_signed_16, bfd_putl16, | |
252b5132 | 207 | |
7920ce38 | 208 | /* Routines to byte-swap various sized integers from the file headers. */ |
252b5132 | 209 | bfd_getl64, bfd_getl_signed_64, bfd_putl64, |
7920ce38 NC |
210 | bfd_getl32, bfd_getl_signed_32, bfd_putl32, |
211 | bfd_getl16, bfd_getl_signed_16, bfd_putl16, | |
212 | ||
213 | /* bfd_check_format: check the format of a file being read. */ | |
214 | { _bfd_dummy_target, /* Unknown format. */ | |
215 | nlmNAME(object_p), /* Assembler/linker output (object file). */ | |
216 | bfd_generic_archive_p, /* An archive. */ | |
217 | nlm_core_file_p /* A core file. */ | |
252b5132 RH |
218 | }, |
219 | ||
7920ce38 | 220 | /* bfd_set_format: set the format of a file being written. */ |
252b5132 RH |
221 | { bfd_false, |
222 | nlm_mkobject, | |
223 | _bfd_generic_mkarchive, | |
224 | bfd_false | |
225 | }, | |
226 | ||
7920ce38 | 227 | /* bfd_write_contents: write cached information into a file being written. */ |
252b5132 RH |
228 | { bfd_false, |
229 | nlmNAME(write_object_contents), | |
230 | _bfd_write_archive_contents, | |
231 | bfd_false | |
232 | }, | |
233 | ||
7920ce38 NC |
234 | /* Initialize a jump table with the standard macro. |
235 | All names start with "nlm". */ | |
252b5132 RH |
236 | BFD_JUMP_TABLE_GENERIC (_bfd_generic), |
237 | BFD_JUMP_TABLE_COPY (_bfd_generic), | |
238 | BFD_JUMP_TABLE_CORE (_bfd_nocore), | |
239 | BFD_JUMP_TABLE_ARCHIVE (_bfd_noarchive), | |
240 | BFD_JUMP_TABLE_SYMBOLS (nlm), | |
241 | BFD_JUMP_TABLE_RELOCS (nlm), | |
242 | BFD_JUMP_TABLE_WRITE (nlm), | |
243 | BFD_JUMP_TABLE_LINK (nlm), | |
244 | BFD_JUMP_TABLE_DYNAMIC (_bfd_nodynamic), | |
245 | ||
c3c89269 NC |
246 | /* Alternative endian target. */ |
247 | #ifdef TARGET_BIG_SYM | |
248 | & TARGET_BIG_SYM, | |
249 | #else | |
250 | NULL, | |
251 | #endif | |
1518639e | 252 | |
7920ce38 NC |
253 | /* Backend_data. */ |
254 | (void *) TARGET_BACKEND_DATA | |
252b5132 RH |
255 | }; |
256 | #endif |