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