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