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