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