]>
Commit | Line | Data |
---|---|---|
252b5132 | 1 | /* Target definitions for NN-bit ELF |
7898deda NC |
2 | Copyright 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001 |
3 | Free Software Foundation, Inc. | |
252b5132 RH |
4 | |
5 | This file is part of BFD, the Binary File Descriptor library. | |
6 | ||
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. | |
11 | ||
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. | |
16 | ||
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 | |
19 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ | |
20 | ||
21 | /* This structure contains everything that BFD knows about a target. | |
22 | It includes things like its byte order, name, what routines to call | |
23 | to do various operations, etc. Every BFD points to a target structure | |
24 | with its "xvec" member. | |
25 | ||
26 | There are two such structures here: one for big-endian machines and | |
27 | one for little-endian machines. */ | |
28 | ||
29 | #define bfd_elfNN_close_and_cleanup _bfd_elf_close_and_cleanup | |
30 | #define bfd_elfNN_bfd_free_cached_info _bfd_generic_bfd_free_cached_info | |
31 | #ifndef bfd_elfNN_get_section_contents | |
32 | #define bfd_elfNN_get_section_contents _bfd_generic_get_section_contents | |
33 | #endif | |
34 | ||
35 | #define bfd_elfNN_canonicalize_dynamic_symtab _bfd_elf_canonicalize_dynamic_symtab | |
36 | #define bfd_elfNN_canonicalize_reloc _bfd_elf_canonicalize_reloc | |
37 | #ifndef bfd_elfNN_find_nearest_line | |
38 | #define bfd_elfNN_find_nearest_line _bfd_elf_find_nearest_line | |
39 | #endif | |
40 | #define bfd_elfNN_read_minisymbols _bfd_elf_read_minisymbols | |
41 | #define bfd_elfNN_minisymbol_to_symbol _bfd_elf_minisymbol_to_symbol | |
42 | #define bfd_elfNN_get_dynamic_symtab_upper_bound _bfd_elf_get_dynamic_symtab_upper_bound | |
43 | #define bfd_elfNN_get_lineno _bfd_elf_get_lineno | |
44 | #ifndef bfd_elfNN_get_reloc_upper_bound | |
45 | #define bfd_elfNN_get_reloc_upper_bound _bfd_elf_get_reloc_upper_bound | |
46 | #endif | |
47 | #define bfd_elfNN_get_symbol_info _bfd_elf_get_symbol_info | |
48 | #define bfd_elfNN_get_symtab _bfd_elf_get_symtab | |
49 | #define bfd_elfNN_get_symtab_upper_bound _bfd_elf_get_symtab_upper_bound | |
50 | #if 0 /* done in elf-bfd.h */ | |
51 | #define bfd_elfNN_link_record_dynamic_symbol _bfd_elf_link_record_dynamic_symbol | |
52 | #endif | |
53 | #define bfd_elfNN_make_empty_symbol _bfd_elf_make_empty_symbol | |
54 | #define bfd_elfNN_new_section_hook _bfd_elf_new_section_hook | |
55 | #define bfd_elfNN_set_arch_mach _bfd_elf_set_arch_mach | |
56 | #ifndef bfd_elfNN_set_section_contents | |
57 | #define bfd_elfNN_set_section_contents _bfd_elf_set_section_contents | |
58 | #endif | |
59 | #define bfd_elfNN_sizeof_headers _bfd_elf_sizeof_headers | |
60 | #define bfd_elfNN_write_object_contents _bfd_elf_write_object_contents | |
61 | #define bfd_elfNN_write_corefile_contents _bfd_elf_write_corefile_contents | |
62 | ||
63 | #define bfd_elfNN_get_section_contents_in_window \ | |
64 | _bfd_generic_get_section_contents_in_window | |
65 | ||
66 | #ifndef elf_backend_got_symbol_offset | |
67 | #define elf_backend_got_symbol_offset (bfd_vma) 0 | |
68 | #endif | |
69 | #ifndef elf_backend_want_got_plt | |
70 | #define elf_backend_want_got_plt 0 | |
71 | #endif | |
72 | #ifndef elf_backend_plt_readonly | |
73 | #define elf_backend_plt_readonly 0 | |
74 | #endif | |
75 | #ifndef elf_backend_want_plt_sym | |
76 | #define elf_backend_want_plt_sym 0 | |
77 | #endif | |
78 | #ifndef elf_backend_plt_not_loaded | |
79 | #define elf_backend_plt_not_loaded 0 | |
80 | #endif | |
81 | #ifndef elf_backend_plt_alignment | |
82 | #define elf_backend_plt_alignment 2 | |
83 | #endif | |
3018b441 RH |
84 | #ifndef elf_backend_want_dynbss |
85 | #define elf_backend_want_dynbss 1 | |
86 | #endif | |
252b5132 RH |
87 | |
88 | #define bfd_elfNN_bfd_debug_info_start bfd_void | |
89 | #define bfd_elfNN_bfd_debug_info_end bfd_void | |
dc810e39 AM |
90 | #define bfd_elfNN_bfd_debug_info_accumulate \ |
91 | (void (*) PARAMS ((bfd*, struct sec *))) bfd_void | |
252b5132 RH |
92 | |
93 | #ifndef bfd_elfNN_bfd_get_relocated_section_contents | |
94 | #define bfd_elfNN_bfd_get_relocated_section_contents \ | |
95 | bfd_generic_get_relocated_section_contents | |
96 | #endif | |
97 | ||
98 | #ifndef bfd_elfNN_bfd_relax_section | |
99 | #define bfd_elfNN_bfd_relax_section bfd_generic_relax_section | |
100 | #endif | |
101 | ||
102 | #ifndef elf_backend_can_gc_sections | |
103 | #define elf_backend_can_gc_sections 0 | |
104 | #endif | |
2517a57f AM |
105 | #ifndef elf_backend_want_got_sym |
106 | #define elf_backend_want_got_sym 1 | |
107 | #endif | |
252b5132 RH |
108 | #ifndef elf_backend_gc_mark_hook |
109 | #define elf_backend_gc_mark_hook NULL | |
110 | #endif | |
111 | #ifndef elf_backend_gc_sweep_hook | |
112 | #define elf_backend_gc_sweep_hook NULL | |
113 | #endif | |
114 | #ifndef bfd_elfNN_bfd_gc_sections | |
115 | #define bfd_elfNN_bfd_gc_sections _bfd_elfNN_gc_sections | |
116 | #endif | |
117 | ||
8550eb6e JJ |
118 | #ifndef bfd_elfNN_bfd_merge_sections |
119 | #define bfd_elfNN_bfd_merge_sections \ | |
120 | _bfd_elf_merge_sections | |
121 | #endif | |
122 | ||
d1cf510e | 123 | #ifndef bfd_elfNN_bfd_make_debug_symbol |
252b5132 RH |
124 | #define bfd_elfNN_bfd_make_debug_symbol \ |
125 | ((asymbol *(*) PARAMS ((bfd *, void *, unsigned long))) bfd_nullvoidptr) | |
d1cf510e | 126 | #endif |
252b5132 RH |
127 | |
128 | #ifndef bfd_elfNN_bfd_copy_private_symbol_data | |
129 | #define bfd_elfNN_bfd_copy_private_symbol_data \ | |
130 | _bfd_elf_copy_private_symbol_data | |
131 | #endif | |
132 | ||
133 | #ifndef bfd_elfNN_bfd_copy_private_section_data | |
134 | #define bfd_elfNN_bfd_copy_private_section_data \ | |
135 | _bfd_elf_copy_private_section_data | |
136 | #endif | |
137 | #ifndef bfd_elfNN_bfd_copy_private_bfd_data | |
138 | #define bfd_elfNN_bfd_copy_private_bfd_data \ | |
139 | ((boolean (*) PARAMS ((bfd *, bfd *))) bfd_true) | |
140 | #endif | |
141 | #ifndef bfd_elfNN_bfd_print_private_bfd_data | |
142 | #define bfd_elfNN_bfd_print_private_bfd_data \ | |
143 | _bfd_elf_print_private_bfd_data | |
144 | #endif | |
145 | #ifndef bfd_elfNN_bfd_merge_private_bfd_data | |
146 | #define bfd_elfNN_bfd_merge_private_bfd_data \ | |
147 | ((boolean (*) PARAMS ((bfd *, bfd *))) bfd_true) | |
148 | #endif | |
149 | #ifndef bfd_elfNN_bfd_set_private_flags | |
150 | #define bfd_elfNN_bfd_set_private_flags \ | |
151 | ((boolean (*) PARAMS ((bfd *, flagword))) bfd_true) | |
152 | #endif | |
153 | #ifndef bfd_elfNN_bfd_is_local_label_name | |
154 | #define bfd_elfNN_bfd_is_local_label_name _bfd_elf_is_local_label_name | |
155 | #endif | |
156 | ||
157 | #ifndef bfd_elfNN_get_dynamic_reloc_upper_bound | |
158 | #define bfd_elfNN_get_dynamic_reloc_upper_bound \ | |
159 | _bfd_elf_get_dynamic_reloc_upper_bound | |
160 | #endif | |
161 | #ifndef bfd_elfNN_canonicalize_dynamic_reloc | |
162 | #define bfd_elfNN_canonicalize_dynamic_reloc \ | |
163 | _bfd_elf_canonicalize_dynamic_reloc | |
164 | #endif | |
165 | ||
8ea2e4bd | 166 | #ifdef elf_backend_relocate_section |
252b5132 RH |
167 | #ifndef bfd_elfNN_bfd_link_hash_table_create |
168 | #define bfd_elfNN_bfd_link_hash_table_create _bfd_elf_link_hash_table_create | |
169 | #endif | |
8ea2e4bd NC |
170 | #else /* ! defined (elf_backend_relocate_section) */ |
171 | /* If no backend relocate_section routine, use the generic linker. | |
172 | Note - this will prevent the port from being able to use some of | |
173 | the other features of the ELF linker, because the generic hash structure | |
174 | does not have the fields needed by the ELF linker. In particular it | |
175 | means that linking directly to S-records will not work. */ | |
176 | #ifndef bfd_elfNN_bfd_link_hash_table_create | |
177 | #define bfd_elfNN_bfd_link_hash_table_create \ | |
178 | _bfd_generic_link_hash_table_create | |
179 | #endif | |
252b5132 RH |
180 | #ifndef bfd_elfNN_bfd_link_add_symbols |
181 | #define bfd_elfNN_bfd_link_add_symbols _bfd_generic_link_add_symbols | |
182 | #endif | |
183 | #ifndef bfd_elfNN_bfd_final_link | |
184 | #define bfd_elfNN_bfd_final_link _bfd_generic_final_link | |
185 | #endif | |
186 | #endif /* ! defined (elf_backend_relocate_section) */ | |
187 | #ifndef bfd_elfNN_bfd_link_split_section | |
188 | #define bfd_elfNN_bfd_link_split_section _bfd_generic_link_split_section | |
189 | #endif | |
190 | ||
191 | #ifndef bfd_elfNN_archive_p | |
192 | #define bfd_elfNN_archive_p bfd_generic_archive_p | |
193 | #endif | |
194 | ||
195 | #ifndef bfd_elfNN_write_archive_contents | |
196 | #define bfd_elfNN_write_archive_contents _bfd_write_archive_contents | |
197 | #endif | |
198 | ||
199 | #ifndef bfd_elfNN_mkobject | |
200 | #define bfd_elfNN_mkobject bfd_elf_mkobject | |
201 | #endif | |
202 | ||
203 | #ifndef bfd_elfNN_mkcorefile | |
204 | #define bfd_elfNN_mkcorefile bfd_elf_mkcorefile | |
205 | #endif | |
206 | ||
207 | #ifndef bfd_elfNN_mkarchive | |
208 | #define bfd_elfNN_mkarchive _bfd_generic_mkarchive | |
209 | #endif | |
210 | ||
211 | #ifndef elf_symbol_leading_char | |
212 | #define elf_symbol_leading_char 0 | |
213 | #endif | |
214 | ||
215 | #ifndef elf_info_to_howto | |
216 | #define elf_info_to_howto 0 | |
217 | #endif | |
218 | ||
219 | #ifndef elf_info_to_howto_rel | |
220 | #define elf_info_to_howto_rel 0 | |
221 | #endif | |
222 | ||
223 | #ifndef ELF_MAXPAGESIZE | |
79e5982f NC |
224 | #error ELF_MAXPAGESIZE is not defined |
225 | #define ELF_MAXPAGESIZE 1 | |
252b5132 RH |
226 | #endif |
227 | ||
228 | #ifndef elf_backend_collect | |
229 | #define elf_backend_collect false | |
230 | #endif | |
231 | #ifndef elf_backend_type_change_ok | |
232 | #define elf_backend_type_change_ok false | |
233 | #endif | |
234 | ||
235 | #ifndef elf_backend_sym_is_global | |
236 | #define elf_backend_sym_is_global 0 | |
237 | #endif | |
238 | #ifndef elf_backend_object_p | |
239 | #define elf_backend_object_p 0 | |
240 | #endif | |
241 | #ifndef elf_backend_symbol_processing | |
242 | #define elf_backend_symbol_processing 0 | |
243 | #endif | |
244 | #ifndef elf_backend_symbol_table_processing | |
245 | #define elf_backend_symbol_table_processing 0 | |
246 | #endif | |
247 | #ifndef elf_backend_get_symbol_type | |
248 | #define elf_backend_get_symbol_type 0 | |
249 | #endif | |
250 | #ifndef elf_backend_section_processing | |
251 | #define elf_backend_section_processing 0 | |
252 | #endif | |
253 | #ifndef elf_backend_section_from_shdr | |
254 | #define elf_backend_section_from_shdr 0 | |
255 | #endif | |
fa152c49 JW |
256 | #ifndef elf_backend_section_flags |
257 | #define elf_backend_section_flags 0 | |
258 | #endif | |
20cfcaae NC |
259 | #ifndef elf_backend_section_from_phdr |
260 | #define elf_backend_section_from_phdr 0 | |
261 | #endif | |
252b5132 RH |
262 | #ifndef elf_backend_fake_sections |
263 | #define elf_backend_fake_sections 0 | |
264 | #endif | |
265 | #ifndef elf_backend_section_from_bfd_section | |
266 | #define elf_backend_section_from_bfd_section 0 | |
267 | #endif | |
268 | #ifndef elf_backend_add_symbol_hook | |
269 | #define elf_backend_add_symbol_hook 0 | |
270 | #endif | |
271 | #ifndef elf_backend_link_output_symbol_hook | |
272 | #define elf_backend_link_output_symbol_hook 0 | |
273 | #endif | |
274 | #ifndef elf_backend_create_dynamic_sections | |
275 | #define elf_backend_create_dynamic_sections 0 | |
276 | #endif | |
277 | #ifndef elf_backend_check_relocs | |
278 | #define elf_backend_check_relocs 0 | |
279 | #endif | |
280 | #ifndef elf_backend_adjust_dynamic_symbol | |
281 | #define elf_backend_adjust_dynamic_symbol 0 | |
282 | #endif | |
283 | #ifndef elf_backend_always_size_sections | |
284 | #define elf_backend_always_size_sections 0 | |
285 | #endif | |
286 | #ifndef elf_backend_size_dynamic_sections | |
287 | #define elf_backend_size_dynamic_sections 0 | |
288 | #endif | |
289 | #ifndef elf_backend_relocate_section | |
290 | #define elf_backend_relocate_section 0 | |
291 | #endif | |
292 | #ifndef elf_backend_finish_dynamic_symbol | |
293 | #define elf_backend_finish_dynamic_symbol 0 | |
294 | #endif | |
295 | #ifndef elf_backend_finish_dynamic_sections | |
296 | #define elf_backend_finish_dynamic_sections 0 | |
297 | #endif | |
298 | #ifndef elf_backend_begin_write_processing | |
299 | #define elf_backend_begin_write_processing 0 | |
300 | #endif | |
301 | #ifndef elf_backend_final_write_processing | |
302 | #define elf_backend_final_write_processing 0 | |
303 | #endif | |
304 | #ifndef elf_backend_additional_program_headers | |
305 | #define elf_backend_additional_program_headers 0 | |
306 | #endif | |
307 | #ifndef elf_backend_modify_segment_map | |
308 | #define elf_backend_modify_segment_map 0 | |
309 | #endif | |
310 | #ifndef elf_backend_ecoff_debug_swap | |
311 | #define elf_backend_ecoff_debug_swap 0 | |
312 | #endif | |
313 | #ifndef elf_backend_got_header_size | |
314 | #define elf_backend_got_header_size 0 | |
315 | #endif | |
316 | #ifndef elf_backend_plt_header_size | |
317 | #define elf_backend_plt_header_size 0 | |
318 | #endif | |
e6c51ed4 NC |
319 | #ifndef elf_backend_post_process_headers |
320 | #define elf_backend_post_process_headers NULL | |
321 | #endif | |
587ff49e RH |
322 | #ifndef elf_backend_print_symbol_all |
323 | #define elf_backend_print_symbol_all NULL | |
324 | #endif | |
325 | #ifndef elf_backend_output_arch_syms | |
326 | #define elf_backend_output_arch_syms NULL | |
327 | #endif | |
c61b8717 RH |
328 | #ifndef elf_backend_copy_indirect_symbol |
329 | #define elf_backend_copy_indirect_symbol _bfd_elf_link_hash_copy_indirect | |
330 | #endif | |
331 | #ifndef elf_backend_hide_symbol | |
332 | #define elf_backend_hide_symbol _bfd_elf_link_hash_hide_symbol | |
333 | #endif | |
9317eacc CM |
334 | #ifndef elf_backend_emit_relocs |
335 | #define elf_backend_emit_relocs NULL | |
336 | #endif | |
337 | #ifndef elf_backend_count_relocs | |
338 | #define elf_backend_count_relocs NULL | |
339 | #endif | |
bb0082d6 AM |
340 | #ifndef elf_backend_grok_prstatus |
341 | #define elf_backend_grok_prstatus NULL | |
342 | #endif | |
343 | #ifndef elf_backend_grok_psinfo | |
344 | #define elf_backend_grok_psinfo NULL | |
345 | #endif | |
4e771d61 NC |
346 | #ifndef elf_backend_sprintf_vma |
347 | #define elf_backend_sprintf_vma _bfd_elf_sprintf_vma | |
348 | #endif | |
349 | #ifndef elf_backend_fprintf_vma | |
350 | #define elf_backend_fprintf_vma _bfd_elf_fprintf_vma | |
351 | #endif | |
db6751f2 JJ |
352 | #ifndef elf_backend_reloc_type_class |
353 | #define elf_backend_reloc_type_class _bfd_elf_reloc_type_class | |
354 | #endif | |
c61b8717 | 355 | |
bf572ba0 MM |
356 | /* Previously, backends could only use SHT_REL or SHT_RELA relocation |
357 | sections, but not both. They defined USE_REL to indicate SHT_REL | |
358 | sections, and left it undefined to indicated SHT_RELA sections. | |
359 | For backwards compatibility, we still support this usage. */ | |
360 | #ifndef USE_REL | |
361 | #define USE_REL 0 | |
362 | #else | |
363 | #undef USE_REL | |
364 | #define USE_REL 1 | |
3e932841 | 365 | #endif |
bf572ba0 MM |
366 | |
367 | /* Use these in new code. */ | |
3e932841 | 368 | #ifndef elf_backend_may_use_rel_p |
bf572ba0 | 369 | #define elf_backend_may_use_rel_p USE_REL |
3e932841 | 370 | #endif |
bf572ba0 MM |
371 | #ifndef elf_backend_may_use_rela_p |
372 | #define elf_backend_may_use_rela_p !USE_REL | |
373 | #endif | |
3e932841 | 374 | #ifndef elf_backend_default_use_rela_p |
bf572ba0 MM |
375 | #define elf_backend_default_use_rela_p !USE_REL |
376 | #endif | |
377 | ||
252b5132 RH |
378 | #ifndef ELF_MACHINE_ALT1 |
379 | #define ELF_MACHINE_ALT1 0 | |
380 | #endif | |
381 | ||
382 | #ifndef ELF_MACHINE_ALT2 | |
383 | #define ELF_MACHINE_ALT2 0 | |
384 | #endif | |
385 | ||
386 | #ifndef elf_backend_size_info | |
387 | #define elf_backend_size_info _bfd_elfNN_size_info | |
388 | #endif | |
389 | ||
86dc0f79 RH |
390 | #ifndef elf_backend_sign_extend_vma |
391 | #define elf_backend_sign_extend_vma 0 | |
392 | #endif | |
393 | ||
252b5132 RH |
394 | extern const struct elf_size_info _bfd_elfNN_size_info; |
395 | ||
dd745cfa | 396 | #ifndef INCLUDED_TARGET_FILE |
dc810e39 | 397 | static const struct elf_backend_data elfNN_bed = |
252b5132 | 398 | { |
252b5132 RH |
399 | ELF_ARCH, /* arch */ |
400 | ELF_MACHINE_CODE, /* elf_machine_code */ | |
401 | ELF_MAXPAGESIZE, /* maxpagesize */ | |
252b5132 RH |
402 | elf_info_to_howto, |
403 | elf_info_to_howto_rel, | |
404 | elf_backend_sym_is_global, | |
405 | elf_backend_object_p, | |
406 | elf_backend_symbol_processing, | |
407 | elf_backend_symbol_table_processing, | |
408 | elf_backend_get_symbol_type, | |
409 | elf_backend_section_processing, | |
410 | elf_backend_section_from_shdr, | |
fa152c49 | 411 | elf_backend_section_flags, |
20cfcaae | 412 | elf_backend_section_from_phdr, |
252b5132 RH |
413 | elf_backend_fake_sections, |
414 | elf_backend_section_from_bfd_section, | |
415 | elf_backend_add_symbol_hook, | |
416 | elf_backend_link_output_symbol_hook, | |
417 | elf_backend_create_dynamic_sections, | |
418 | elf_backend_check_relocs, | |
419 | elf_backend_adjust_dynamic_symbol, | |
420 | elf_backend_always_size_sections, | |
421 | elf_backend_size_dynamic_sections, | |
422 | elf_backend_relocate_section, | |
423 | elf_backend_finish_dynamic_symbol, | |
424 | elf_backend_finish_dynamic_sections, | |
425 | elf_backend_begin_write_processing, | |
426 | elf_backend_final_write_processing, | |
427 | elf_backend_additional_program_headers, | |
428 | elf_backend_modify_segment_map, | |
429 | elf_backend_gc_mark_hook, | |
430 | elf_backend_gc_sweep_hook, | |
e6c51ed4 | 431 | elf_backend_post_process_headers, |
587ff49e RH |
432 | elf_backend_print_symbol_all, |
433 | elf_backend_output_arch_syms, | |
c61b8717 RH |
434 | elf_backend_copy_indirect_symbol, |
435 | elf_backend_hide_symbol, | |
9317eacc CM |
436 | elf_backend_emit_relocs, |
437 | elf_backend_count_relocs, | |
bb0082d6 AM |
438 | elf_backend_grok_prstatus, |
439 | elf_backend_grok_psinfo, | |
4e771d61 NC |
440 | elf_backend_sprintf_vma, |
441 | elf_backend_fprintf_vma, | |
db6751f2 | 442 | elf_backend_reloc_type_class, |
252b5132 RH |
443 | elf_backend_ecoff_debug_swap, |
444 | ELF_MACHINE_ALT1, | |
445 | ELF_MACHINE_ALT2, | |
446 | &elf_backend_size_info, | |
447 | elf_backend_got_symbol_offset, | |
448 | elf_backend_got_header_size, | |
449 | elf_backend_plt_header_size, | |
86dc0f79 RH |
450 | elf_backend_collect, |
451 | elf_backend_type_change_ok, | |
bf572ba0 MM |
452 | elf_backend_may_use_rel_p, |
453 | elf_backend_may_use_rela_p, | |
454 | elf_backend_default_use_rela_p, | |
86dc0f79 | 455 | elf_backend_sign_extend_vma, |
252b5132 RH |
456 | elf_backend_want_got_plt, |
457 | elf_backend_plt_readonly, | |
458 | elf_backend_want_plt_sym, | |
459 | elf_backend_plt_not_loaded, | |
460 | elf_backend_plt_alignment, | |
2ac8ce5f | 461 | elf_backend_can_gc_sections, |
2517a57f AM |
462 | elf_backend_want_dynbss, |
463 | elf_backend_want_got_sym | |
252b5132 | 464 | }; |
dd745cfa | 465 | #endif |
252b5132 | 466 | |
c3c89269 NC |
467 | /* Forward declaration for use when initialising alternative_target field. */ |
468 | #ifdef TARGET_LITTLE_SYM | |
469 | extern const bfd_target TARGET_LITTLE_SYM; | |
470 | #endif | |
471 | ||
252b5132 RH |
472 | #ifdef TARGET_BIG_SYM |
473 | const bfd_target TARGET_BIG_SYM = | |
474 | { | |
475 | /* name: identify kind of target */ | |
476 | TARGET_BIG_NAME, | |
477 | ||
478 | /* flavour: general indication about file */ | |
479 | bfd_target_elf_flavour, | |
480 | ||
481 | /* byteorder: data is big endian */ | |
482 | BFD_ENDIAN_BIG, | |
483 | ||
484 | /* header_byteorder: header is also big endian */ | |
485 | BFD_ENDIAN_BIG, | |
486 | ||
487 | /* object_flags: mask of all file flags */ | |
e0aae569 RH |
488 | (HAS_RELOC | EXEC_P | HAS_LINENO | HAS_DEBUG | HAS_SYMS | HAS_LOCALS |
489 | | DYNAMIC | WP_TEXT | D_PAGED), | |
252b5132 RH |
490 | |
491 | /* section_flags: mask of all section flags */ | |
e0aae569 RH |
492 | (SEC_HAS_CONTENTS | SEC_ALLOC | SEC_LOAD | SEC_RELOC | SEC_READONLY |
493 | | SEC_CODE | SEC_DATA | SEC_DEBUGGING | SEC_EXCLUDE | SEC_SORT_ENTRIES | |
494 | | SEC_ARCH_BIT_0 | SEC_SMALL_DATA | SEC_MERGE | SEC_STRINGS), | |
252b5132 RH |
495 | |
496 | /* leading_symbol_char: is the first char of a user symbol | |
497 | predictable, and if so what is it */ | |
498 | elf_symbol_leading_char, | |
499 | ||
500 | /* ar_pad_char: pad character for filenames within an archive header | |
501 | FIXME: this really has nothing to do with ELF, this is a characteristic | |
502 | of the archiver and/or os and should be independently tunable */ | |
503 | '/', | |
504 | ||
505 | /* ar_max_namelen: maximum number of characters in an archive header | |
506 | FIXME: this really has nothing to do with ELF, this is a characteristic | |
507 | of the archiver and should be independently tunable. This value is | |
508 | a WAG (wild a** guess) */ | |
509 | 14, | |
510 | ||
511 | /* Routines to byte-swap various sized integers from the data sections */ | |
512 | bfd_getb64, bfd_getb_signed_64, bfd_putb64, | |
513 | bfd_getb32, bfd_getb_signed_32, bfd_putb32, | |
514 | bfd_getb16, bfd_getb_signed_16, bfd_putb16, | |
515 | ||
516 | /* Routines to byte-swap various sized integers from the file headers */ | |
517 | bfd_getb64, bfd_getb_signed_64, bfd_putb64, | |
518 | bfd_getb32, bfd_getb_signed_32, bfd_putb32, | |
519 | bfd_getb16, bfd_getb_signed_16, bfd_putb16, | |
520 | ||
521 | /* bfd_check_format: check the format of a file being read */ | |
522 | { _bfd_dummy_target, /* unknown format */ | |
523 | bfd_elfNN_object_p, /* assembler/linker output (object file) */ | |
524 | bfd_elfNN_archive_p, /* an archive */ | |
525 | bfd_elfNN_core_file_p /* a core file */ | |
526 | }, | |
527 | ||
528 | /* bfd_set_format: set the format of a file being written */ | |
529 | { bfd_false, | |
530 | bfd_elfNN_mkobject, | |
531 | bfd_elfNN_mkarchive, | |
532 | bfd_elfNN_mkcorefile | |
533 | }, | |
534 | ||
535 | /* bfd_write_contents: write cached information into a file being written */ | |
536 | { bfd_false, | |
537 | bfd_elfNN_write_object_contents, | |
538 | bfd_elfNN_write_archive_contents, | |
539 | bfd_elfNN_write_corefile_contents, | |
540 | }, | |
541 | ||
542 | BFD_JUMP_TABLE_GENERIC (bfd_elfNN), | |
543 | BFD_JUMP_TABLE_COPY (bfd_elfNN), | |
544 | BFD_JUMP_TABLE_CORE (bfd_elfNN), | |
545 | #ifdef bfd_elfNN_archive_functions | |
546 | BFD_JUMP_TABLE_ARCHIVE (bfd_elfNN_archive), | |
547 | #else | |
548 | BFD_JUMP_TABLE_ARCHIVE (_bfd_archive_coff), | |
549 | #endif | |
550 | BFD_JUMP_TABLE_SYMBOLS (bfd_elfNN), | |
551 | BFD_JUMP_TABLE_RELOCS (bfd_elfNN), | |
552 | BFD_JUMP_TABLE_WRITE (bfd_elfNN), | |
553 | BFD_JUMP_TABLE_LINK (bfd_elfNN), | |
554 | BFD_JUMP_TABLE_DYNAMIC (bfd_elfNN), | |
555 | ||
c3c89269 NC |
556 | /* Alternative endian target. */ |
557 | #ifdef TARGET_LITTLE_SYM | |
558 | & TARGET_LITTLE_SYM, | |
559 | #else | |
560 | NULL, | |
561 | #endif | |
562 | ||
252b5132 | 563 | /* backend_data: */ |
c3c89269 | 564 | (PTR) &elfNN_bed |
252b5132 RH |
565 | }; |
566 | #endif | |
567 | ||
568 | #ifdef TARGET_LITTLE_SYM | |
569 | const bfd_target TARGET_LITTLE_SYM = | |
570 | { | |
571 | /* name: identify kind of target */ | |
572 | TARGET_LITTLE_NAME, | |
573 | ||
574 | /* flavour: general indication about file */ | |
575 | bfd_target_elf_flavour, | |
576 | ||
577 | /* byteorder: data is little endian */ | |
578 | BFD_ENDIAN_LITTLE, | |
579 | ||
580 | /* header_byteorder: header is also little endian */ | |
581 | BFD_ENDIAN_LITTLE, | |
582 | ||
583 | /* object_flags: mask of all file flags */ | |
e0aae569 RH |
584 | (HAS_RELOC | EXEC_P | HAS_LINENO | HAS_DEBUG | HAS_SYMS | HAS_LOCALS |
585 | | DYNAMIC | WP_TEXT | D_PAGED), | |
252b5132 RH |
586 | |
587 | /* section_flags: mask of all section flags */ | |
e0aae569 RH |
588 | (SEC_HAS_CONTENTS | SEC_ALLOC | SEC_LOAD | SEC_RELOC | SEC_READONLY |
589 | | SEC_CODE | SEC_DATA | SEC_DEBUGGING | SEC_EXCLUDE | SEC_SORT_ENTRIES | |
590 | | SEC_ARCH_BIT_0 | SEC_SMALL_DATA | SEC_MERGE | SEC_STRINGS), | |
252b5132 RH |
591 | |
592 | /* leading_symbol_char: is the first char of a user symbol | |
593 | predictable, and if so what is it */ | |
594 | elf_symbol_leading_char, | |
595 | ||
596 | /* ar_pad_char: pad character for filenames within an archive header | |
597 | FIXME: this really has nothing to do with ELF, this is a characteristic | |
598 | of the archiver and/or os and should be independently tunable */ | |
599 | '/', | |
600 | ||
601 | /* ar_max_namelen: maximum number of characters in an archive header | |
602 | FIXME: this really has nothing to do with ELF, this is a characteristic | |
603 | of the archiver and should be independently tunable. This value is | |
604 | a WAG (wild a** guess) */ | |
605 | 14, | |
606 | ||
607 | /* Routines to byte-swap various sized integers from the data sections */ | |
608 | bfd_getl64, bfd_getl_signed_64, bfd_putl64, | |
609 | bfd_getl32, bfd_getl_signed_32, bfd_putl32, | |
610 | bfd_getl16, bfd_getl_signed_16, bfd_putl16, | |
611 | ||
612 | /* Routines to byte-swap various sized integers from the file headers */ | |
613 | bfd_getl64, bfd_getl_signed_64, bfd_putl64, | |
614 | bfd_getl32, bfd_getl_signed_32, bfd_putl32, | |
615 | bfd_getl16, bfd_getl_signed_16, bfd_putl16, | |
616 | ||
617 | /* bfd_check_format: check the format of a file being read */ | |
618 | { _bfd_dummy_target, /* unknown format */ | |
619 | bfd_elfNN_object_p, /* assembler/linker output (object file) */ | |
620 | bfd_elfNN_archive_p, /* an archive */ | |
621 | bfd_elfNN_core_file_p /* a core file */ | |
622 | }, | |
623 | ||
624 | /* bfd_set_format: set the format of a file being written */ | |
625 | { bfd_false, | |
626 | bfd_elfNN_mkobject, | |
627 | bfd_elfNN_mkarchive, | |
628 | bfd_elfNN_mkcorefile | |
629 | }, | |
630 | ||
631 | /* bfd_write_contents: write cached information into a file being written */ | |
632 | { bfd_false, | |
633 | bfd_elfNN_write_object_contents, | |
634 | bfd_elfNN_write_archive_contents, | |
635 | bfd_elfNN_write_corefile_contents, | |
636 | }, | |
637 | ||
638 | BFD_JUMP_TABLE_GENERIC (bfd_elfNN), | |
639 | BFD_JUMP_TABLE_COPY (bfd_elfNN), | |
640 | BFD_JUMP_TABLE_CORE (bfd_elfNN), | |
641 | #ifdef bfd_elfNN_archive_functions | |
642 | BFD_JUMP_TABLE_ARCHIVE (bfd_elfNN_archive), | |
643 | #else | |
644 | BFD_JUMP_TABLE_ARCHIVE (_bfd_archive_coff), | |
645 | #endif | |
646 | BFD_JUMP_TABLE_SYMBOLS (bfd_elfNN), | |
647 | BFD_JUMP_TABLE_RELOCS (bfd_elfNN), | |
648 | BFD_JUMP_TABLE_WRITE (bfd_elfNN), | |
649 | BFD_JUMP_TABLE_LINK (bfd_elfNN), | |
650 | BFD_JUMP_TABLE_DYNAMIC (bfd_elfNN), | |
651 | ||
c3c89269 NC |
652 | /* Alternative endian target. */ |
653 | #ifdef TARGET_BIG_SYM | |
654 | & TARGET_BIG_SYM, | |
655 | #else | |
656 | NULL, | |
657 | #endif | |
3e932841 | 658 | |
252b5132 | 659 | /* backend_data: */ |
c3c89269 | 660 | (PTR) &elfNN_bed |
252b5132 RH |
661 | }; |
662 | #endif |