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