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