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