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