]> git.ipfire.org Git - thirdparty/binutils-gdb.git/blame - bfd/aout-target.h
* config/sh/tm-sh.h (BELIEVE_PCC_PROMOTION): Define, so that
[thirdparty/binutils-gdb.git] / bfd / aout-target.h
CommitLineData
582bc90a 1/* Define a target vector and some small routines for a variant of a.out.
f5419a59 2 Copyright (C) 1990, 1991, 1992, 1993, 1994 Free Software Foundation, Inc.
e98e6ec1
SC
3
4This file is part of BFD, the Binary File Descriptor library.
5
6This program is free software; you can redistribute it and/or modify
7it under the terms of the GNU General Public License as published by
8the Free Software Foundation; either version 2 of the License, or
9(at your option) any later version.
10
11This program is distributed in the hope that it will be useful,
12but WITHOUT ANY WARRANTY; without even the implied warranty of
13MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14GNU General Public License for more details.
15
16You should have received a copy of the GNU General Public License
17along with this program; if not, write to the Free Software
2a01c351 18Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
e98e6ec1 19
582bc90a
PB
20#include "aout/aout64.h"
21#include "aout/stab_gnu.h"
22#include "aout/ar.h"
23/*#include "libaout.h"*/
24
2a01c351 25extern reloc_howto_type * NAME(aout,reloc_type_lookup) ();
214f8f23 26
e98e6ec1
SC
27/* Set parameters about this a.out file that are machine-dependent.
28 This routine is called from some_aout_object_p just before it returns. */
214f8f23 29#ifndef MY_callback
a932d0ff 30static const bfd_target *
57a1867e
DM
31MY(callback) (abfd)
32 bfd *abfd;
e98e6ec1
SC
33{
34 struct internal_exec *execp = exec_hdr (abfd);
a932d0ff
ILT
35 unsigned int arch_align_power;
36 unsigned long arch_align;
294eaca4
SC
37
38 /* Calculate the file positions of the parts of a newly read aout header */
e98e6ec1
SC
39 obj_textsec (abfd)->_raw_size = N_TXTSIZE(*execp);
40
41 /* The virtual memory addresses of the sections */
42 obj_textsec (abfd)->vma = N_TXTADDR(*execp);
43 obj_datasec (abfd)->vma = N_DATADDR(*execp);
44 obj_bsssec (abfd)->vma = N_BSSADDR(*execp);
45
64d5f5d0
ILT
46 obj_textsec (abfd)->lma = obj_textsec (abfd)->vma;
47 obj_datasec (abfd)->lma = obj_datasec (abfd)->vma;
48 obj_bsssec (abfd)->lma = obj_bsssec (abfd)->vma;
49
e98e6ec1
SC
50 /* The file offsets of the sections */
51 obj_textsec (abfd)->filepos = N_TXTOFF (*execp);
52 obj_datasec (abfd)->filepos = N_DATOFF (*execp);
53
54 /* The file offsets of the relocation info */
55 obj_textsec (abfd)->rel_filepos = N_TRELOFF(*execp);
56 obj_datasec (abfd)->rel_filepos = N_DRELOFF(*execp);
57
58 /* The file offsets of the string table and symbol table. */
59 obj_sym_filepos (abfd) = N_SYMOFF (*execp);
60 obj_str_filepos (abfd) = N_STROFF (*execp);
61
582bc90a 62 /* Determine the architecture and machine type of the object file. */
e98e6ec1
SC
63#ifdef SET_ARCH_MACH
64 SET_ARCH_MACH(abfd, *execp);
65#else
66 bfd_default_set_arch_mach(abfd, DEFAULT_ARCH, 0);
67#endif
68
785e2b52
ILT
69 /* Now that we know the architecture, set the alignments of the
70 sections. This is normally done by NAME(aout,new_section_hook),
71 but when the initial sections were created the architecture had
a932d0ff
ILT
72 not yet been set. However, for backward compatibility, we don't
73 set the alignment power any higher than as required by the size
74 of the section. */
75 arch_align_power = bfd_get_arch_info (abfd)->section_align_power;
76 arch_align = 1 << arch_align_power;
77 if ((BFD_ALIGN (obj_textsec (abfd)->_raw_size, arch_align)
78 == obj_textsec (abfd)->_raw_size)
79 && (BFD_ALIGN (obj_datasec (abfd)->_raw_size, arch_align)
80 == obj_datasec (abfd)->_raw_size)
81 && (BFD_ALIGN (obj_bsssec (abfd)->_raw_size, arch_align)
82 == obj_bsssec (abfd)->_raw_size))
83 {
84 obj_textsec (abfd)->alignment_power = arch_align_power;
85 obj_datasec (abfd)->alignment_power = arch_align_power;
86 obj_bsssec (abfd)->alignment_power = arch_align_power;
87 }
785e2b52 88
294eaca4
SC
89 /* Don't set sizes now -- can't be sure until we know arch & mach.
90 Sizes get set in set_sizes callback, later. */
91#if 0
34e9ffbc 92 adata(abfd).page_size = TARGET_PAGE_SIZE;
e98e6ec1
SC
93#ifdef SEGMENT_SIZE
94 adata(abfd).segment_size = SEGMENT_SIZE;
95#else
34e9ffbc 96 adata(abfd).segment_size = TARGET_PAGE_SIZE;
e98e6ec1
SC
97#endif
98 adata(abfd).exec_bytes_size = EXEC_BYTES_SIZE;
294eaca4 99#endif
e98e6ec1
SC
100
101 return abfd->xvec;
102}
214f8f23 103#endif
e98e6ec1
SC
104
105#ifndef MY_object_p
106/* Finish up the reading of an a.out file header */
107
a932d0ff 108static const bfd_target *
57a1867e
DM
109MY(object_p) (abfd)
110 bfd *abfd;
e98e6ec1
SC
111{
112 struct external_exec exec_bytes; /* Raw exec header from file */
113 struct internal_exec exec; /* Cleaned-up exec header */
a932d0ff 114 const bfd_target *target;
e98e6ec1
SC
115
116 if (bfd_read ((PTR) &exec_bytes, 1, EXEC_BYTES_SIZE, abfd)
117 != EXEC_BYTES_SIZE) {
4002f18a
ILT
118 if (bfd_get_error () != bfd_error_system_call)
119 bfd_set_error (bfd_error_wrong_format);
e98e6ec1
SC
120 return 0;
121 }
122
3f99570e
JK
123#ifdef SWAP_MAGIC
124 exec.a_info = SWAP_MAGIC (exec_bytes.e_info);
4c3721d5 125#else
e98e6ec1 126 exec.a_info = bfd_h_get_32 (abfd, exec_bytes.e_info);
3f99570e 127#endif /* SWAP_MAGIC */
e98e6ec1
SC
128
129 if (N_BADMAG (exec)) return 0;
4c3721d5
ILT
130#ifdef MACHTYPE_OK
131 if (!(MACHTYPE_OK (N_MACHTYPE (exec)))) return 0;
132#endif
e98e6ec1
SC
133
134 NAME(aout,swap_exec_header_in)(abfd, &exec_bytes, &exec);
a932d0ff
ILT
135
136#ifdef SWAP_MAGIC
137 /* swap_exec_header_in read in a_info with the wrong byte order */
138 exec.a_info = SWAP_MAGIC (exec_bytes.e_info);
139#endif /* SWAP_MAGIC */
140
e98e6ec1
SC
141 target = NAME(aout,some_aout_object_p) (abfd, &exec, MY(callback));
142
143#ifdef ENTRY_CAN_BE_ZERO
144 /* The NEWSOS3 entry-point is/was 0, which (amongst other lossage)
145 * means that it isn't obvious if EXEC_P should be set.
146 * All of the following must be true for an executable:
147 * There must be no relocations, the bfd can be neither an
148 * archive nor an archive element, and the file must be executable. */
149
150 if (exec.a_trsize + exec.a_drsize == 0
151 && bfd_get_format(abfd) == bfd_object && abfd->my_archive == NULL)
152 {
153 struct stat buf;
154#ifndef S_IXUSR
155#define S_IXUSR 0100 /* Execute by owner. */
156#endif
157 if (stat(abfd->filename, &buf) == 0 && (buf.st_mode & S_IXUSR))
158 abfd->flags |= EXEC_P;
159 }
160#endif /* ENTRY_CAN_BE_ZERO */
161
162 return target;
163}
164#define MY_object_p MY(object_p)
165#endif
166
167
168#ifndef MY_mkobject
169static boolean
57a1867e
DM
170MY(mkobject) (abfd)
171 bfd *abfd;
e98e6ec1
SC
172{
173 if (NAME(aout,mkobject)(abfd) == false)
174 return false;
294eaca4
SC
175#if 0 /* Sizes get set in set_sizes callback, later, after we know
176 the architecture and machine. */
34e9ffbc 177 adata(abfd).page_size = TARGET_PAGE_SIZE;
e98e6ec1
SC
178#ifdef SEGMENT_SIZE
179 adata(abfd).segment_size = SEGMENT_SIZE;
180#else
34e9ffbc 181 adata(abfd).segment_size = TARGET_PAGE_SIZE;
e98e6ec1
SC
182#endif
183 adata(abfd).exec_bytes_size = EXEC_BYTES_SIZE;
294eaca4 184#endif
e98e6ec1
SC
185 return true;
186}
187#define MY_mkobject MY(mkobject)
188#endif
189
f5419a59
ILT
190#ifndef MY_bfd_copy_private_section_data
191
192/* Copy private section data. This actually does nothing with the
193 sections. It copies the subformat field. We copy it here, because
aa91350c
ILT
194 we need to know whether this is a QMAGIC file before we set the
195 section contents, and copy_private_bfd_data is not called until
196 after the section contents have been set. */
f5419a59
ILT
197
198/*ARGSUSED*/
199static boolean
200MY_bfd_copy_private_section_data (ibfd, isec, obfd, osec)
201 bfd *ibfd;
202 asection *isec;
203 bfd *obfd;
204 asection *osec;
205{
d7785845
ILT
206 if (bfd_get_flavour (obfd) == bfd_target_aout_flavour)
207 obj_aout_subformat (obfd) = obj_aout_subformat (ibfd);
f5419a59
ILT
208 return true;
209}
210
211#endif
212
e98e6ec1
SC
213/* Write an object file.
214 Section contents have already been written. We write the
215 file header, symbols, and relocation. */
216
217#ifndef MY_write_object_contents
218static boolean
57a1867e
DM
219MY(write_object_contents) (abfd)
220 bfd *abfd;
e98e6ec1 221{
e98e6ec1
SC
222 struct external_exec exec_bytes;
223 struct internal_exec *execp = exec_hdr (abfd);
224
582bc90a
PB
225#if CHOOSE_RELOC_SIZE
226 CHOOSE_RELOC_SIZE(abfd);
227#else
228 obj_reloc_entry_size (abfd) = RELOC_STD_SIZE;
229#endif
230
e98e6ec1 231 WRITE_HEADERS(abfd, execp);
582bc90a 232
e98e6ec1
SC
233 return true;
234}
235#define MY_write_object_contents MY(write_object_contents)
236#endif
237
294eaca4
SC
238#ifndef MY_set_sizes
239static boolean
57a1867e
DM
240MY(set_sizes) (abfd)
241 bfd *abfd;
294eaca4 242{
34e9ffbc 243 adata(abfd).page_size = TARGET_PAGE_SIZE;
a932d0ff 244
294eaca4
SC
245#ifdef SEGMENT_SIZE
246 adata(abfd).segment_size = SEGMENT_SIZE;
247#else
34e9ffbc 248 adata(abfd).segment_size = TARGET_PAGE_SIZE;
294eaca4 249#endif
a932d0ff
ILT
250
251#ifdef ZMAGIC_DISK_BLOCK_SIZE
252 adata(abfd).zmagic_disk_block_size = ZMAGIC_DISK_BLOCK_SIZE;
253#else
34e9ffbc 254 adata(abfd).zmagic_disk_block_size = TARGET_PAGE_SIZE;
a932d0ff
ILT
255#endif
256
294eaca4
SC
257 adata(abfd).exec_bytes_size = EXEC_BYTES_SIZE;
258 return true;
259}
260#define MY_set_sizes MY(set_sizes)
261#endif
262
f5419a59
ILT
263#ifndef MY_exec_hdr_flags
264#define MY_exec_hdr_flags 0
265#endif
266
294eaca4 267#ifndef MY_backend_data
57a1867e 268
a932d0ff
ILT
269#ifndef MY_zmagic_contiguous
270#define MY_zmagic_contiguous 0
271#endif
f5419a59
ILT
272#ifndef MY_text_includes_header
273#define MY_text_includes_header 0
274#endif
2a01c351
KR
275#ifndef MY_exec_header_not_counted
276#define MY_exec_header_not_counted 0
277#endif
f5419a59
ILT
278#ifndef MY_add_dynamic_symbols
279#define MY_add_dynamic_symbols 0
280#endif
281#ifndef MY_add_one_symbol
282#define MY_add_one_symbol 0
283#endif
284#ifndef MY_link_dynamic_object
285#define MY_link_dynamic_object 0
286#endif
287#ifndef MY_write_dynamic_symbol
288#define MY_write_dynamic_symbol 0
289#endif
290#ifndef MY_check_dynamic_reloc
291#define MY_check_dynamic_reloc 0
57a1867e 292#endif
f5419a59
ILT
293#ifndef MY_finish_dynamic_link
294#define MY_finish_dynamic_link 0
57a1867e
DM
295#endif
296
294eaca4 297static CONST struct aout_backend_data MY(backend_data) = {
a932d0ff 298 MY_zmagic_contiguous,
f5419a59
ILT
299 MY_text_includes_header,
300 MY_exec_hdr_flags,
294eaca4
SC
301 0, /* text vma? */
302 MY_set_sizes,
2a01c351 303 MY_exec_header_not_counted,
f5419a59
ILT
304 MY_add_dynamic_symbols,
305 MY_add_one_symbol,
306 MY_link_dynamic_object,
307 MY_write_dynamic_symbol,
308 MY_check_dynamic_reloc,
309 MY_finish_dynamic_link
294eaca4
SC
310};
311#define MY_backend_data &MY(backend_data)
312#endif
313
f5419a59 314#ifndef MY_final_link_callback
4c3721d5 315
f5419a59 316/* Callback for the final_link routine to set the section offsets. */
4c3721d5 317
f5419a59 318static void MY_final_link_callback
4c3721d5
ILT
319 PARAMS ((bfd *, file_ptr *, file_ptr *, file_ptr *));
320
321static void
f5419a59 322MY_final_link_callback (abfd, ptreloff, pdreloff, psymoff)
4c3721d5
ILT
323 bfd *abfd;
324 file_ptr *ptreloff;
325 file_ptr *pdreloff;
326 file_ptr *psymoff;
327{
328 struct internal_exec *execp = exec_hdr (abfd);
329
330 *ptreloff = N_TRELOFF (*execp);
331 *pdreloff = N_DRELOFF (*execp);
332 *psymoff = N_SYMOFF (*execp);
333}
334
f5419a59
ILT
335#endif
336
337#ifndef MY_bfd_final_link
338
339/* Final link routine. We need to use a call back to get the correct
340 offsets in the output file. */
341
4c3721d5
ILT
342static boolean
343MY_bfd_final_link (abfd, info)
344 bfd *abfd;
345 struct bfd_link_info *info;
346{
f5419a59 347 return NAME(aout,final_link) (abfd, info, MY_final_link_callback);
4c3721d5
ILT
348}
349
350#endif
351
e98e6ec1
SC
352/* We assume BFD generic archive files. */
353#ifndef MY_openr_next_archived_file
354#define MY_openr_next_archived_file bfd_generic_openr_next_archived_file
355#endif
64d5f5d0
ILT
356#ifndef MY_get_elt_at_index
357#define MY_get_elt_at_index _bfd_generic_get_elt_at_index
358#endif
e98e6ec1
SC
359#ifndef MY_generic_stat_arch_elt
360#define MY_generic_stat_arch_elt bfd_generic_stat_arch_elt
361#endif
362#ifndef MY_slurp_armap
363#define MY_slurp_armap bfd_slurp_bsd_armap
364#endif
365#ifndef MY_slurp_extended_name_table
582bc90a 366#define MY_slurp_extended_name_table _bfd_slurp_extended_name_table
e98e6ec1 367#endif
2a01c351
KR
368#ifndef MY_construct_extended_name_table
369#define MY_construct_extended_name_table \
370 _bfd_archive_bsd_construct_extended_name_table
371#endif
e98e6ec1
SC
372#ifndef MY_write_armap
373#define MY_write_armap bsd_write_armap
374#endif
34e9ffbc
NH
375#ifndef MY_read_ar_hdr
376#define MY_read_ar_hdr _bfd_generic_read_ar_hdr
377#endif
e98e6ec1
SC
378#ifndef MY_truncate_arname
379#define MY_truncate_arname bfd_bsd_truncate_arname
380#endif
d7785845
ILT
381#ifndef MY_update_armap_timestamp
382#define MY_update_armap_timestamp _bfd_archive_bsd_update_armap_timestamp
383#endif
e98e6ec1
SC
384
385/* No core file defined here -- configure in trad-core.c separately. */
386#ifndef MY_core_file_failing_command
6812b607 387#define MY_core_file_failing_command _bfd_nocore_core_file_failing_command
e98e6ec1
SC
388#endif
389#ifndef MY_core_file_failing_signal
6812b607 390#define MY_core_file_failing_signal _bfd_nocore_core_file_failing_signal
e98e6ec1
SC
391#endif
392#ifndef MY_core_file_matches_executable_p
393#define MY_core_file_matches_executable_p \
6812b607 394 _bfd_nocore_core_file_matches_executable_p
e98e6ec1
SC
395#endif
396#ifndef MY_core_file_p
397#define MY_core_file_p _bfd_dummy_target
398#endif
399
400#ifndef MY_bfd_debug_info_start
401#define MY_bfd_debug_info_start bfd_void
402#endif
403#ifndef MY_bfd_debug_info_end
404#define MY_bfd_debug_info_end bfd_void
405#endif
406#ifndef MY_bfd_debug_info_accumulate
1f29e30b
JG
407#define MY_bfd_debug_info_accumulate \
408 (void (*) PARAMS ((bfd*, struct sec *))) bfd_void
e98e6ec1
SC
409#endif
410
411#ifndef MY_core_file_failing_command
412#define MY_core_file_failing_command NAME(aout,core_file_failing_command)
413#endif
414#ifndef MY_core_file_failing_signal
415#define MY_core_file_failing_signal NAME(aout,core_file_failing_signal)
416#endif
417#ifndef MY_core_file_matches_executable_p
418#define MY_core_file_matches_executable_p NAME(aout,core_file_matches_executable_p)
419#endif
e98e6ec1
SC
420#ifndef MY_set_section_contents
421#define MY_set_section_contents NAME(aout,set_section_contents)
422#endif
423#ifndef MY_get_section_contents
424#define MY_get_section_contents NAME(aout,get_section_contents)
425#endif
64d5f5d0
ILT
426#ifndef MY_get_section_contents_in_window
427#define MY_get_section_contents_in_window _bfd_generic_get_section_contents_in_window
428#endif
e98e6ec1
SC
429#ifndef MY_new_section_hook
430#define MY_new_section_hook NAME(aout,new_section_hook)
431#endif
432#ifndef MY_get_symtab_upper_bound
433#define MY_get_symtab_upper_bound NAME(aout,get_symtab_upper_bound)
434#endif
435#ifndef MY_get_symtab
436#define MY_get_symtab NAME(aout,get_symtab)
437#endif
438#ifndef MY_get_reloc_upper_bound
439#define MY_get_reloc_upper_bound NAME(aout,get_reloc_upper_bound)
440#endif
441#ifndef MY_canonicalize_reloc
442#define MY_canonicalize_reloc NAME(aout,canonicalize_reloc)
443#endif
444#ifndef MY_make_empty_symbol
445#define MY_make_empty_symbol NAME(aout,make_empty_symbol)
446#endif
447#ifndef MY_print_symbol
448#define MY_print_symbol NAME(aout,print_symbol)
449#endif
4c3721d5
ILT
450#ifndef MY_get_symbol_info
451#define MY_get_symbol_info NAME(aout,get_symbol_info)
452#endif
e98e6ec1
SC
453#ifndef MY_get_lineno
454#define MY_get_lineno NAME(aout,get_lineno)
455#endif
456#ifndef MY_set_arch_mach
457#define MY_set_arch_mach NAME(aout,set_arch_mach)
458#endif
e98e6ec1
SC
459#ifndef MY_find_nearest_line
460#define MY_find_nearest_line NAME(aout,find_nearest_line)
461#endif
e98e6ec1
SC
462#ifndef MY_sizeof_headers
463#define MY_sizeof_headers NAME(aout,sizeof_headers)
464#endif
4c3721d5
ILT
465#ifndef MY_bfd_get_relocated_section_contents
466#define MY_bfd_get_relocated_section_contents \
467 bfd_generic_get_relocated_section_contents
e98e6ec1 468#endif
4c3721d5
ILT
469#ifndef MY_bfd_relax_section
470#define MY_bfd_relax_section bfd_generic_relax_section
471#endif
472#ifndef MY_bfd_reloc_type_lookup
473#define MY_bfd_reloc_type_lookup NAME(aout,reloc_type_lookup)
e98e6ec1 474#endif
4c3721d5
ILT
475#ifndef MY_bfd_make_debug_symbol
476#define MY_bfd_make_debug_symbol 0
e98e6ec1 477#endif
2a01c351
KR
478#ifndef MY_read_minisymbols
479#define MY_read_minisymbols NAME(aout,read_minisymbols)
480#endif
481#ifndef MY_minisymbol_to_symbol
482#define MY_minisymbol_to_symbol NAME(aout,minisymbol_to_symbol)
483#endif
4c3721d5
ILT
484#ifndef MY_bfd_link_hash_table_create
485#define MY_bfd_link_hash_table_create NAME(aout,link_hash_table_create)
582bc90a 486#endif
4c3721d5
ILT
487#ifndef MY_bfd_link_add_symbols
488#define MY_bfd_link_add_symbols NAME(aout,link_add_symbols)
582bc90a 489#endif
2a01c351
KR
490#ifndef MY_bfd_link_split_section
491#define MY_bfd_link_split_section _bfd_generic_link_split_section
492#endif
493
294eaca4 494
9deaaaf1 495#ifndef MY_bfd_copy_private_bfd_data
6812b607 496#define MY_bfd_copy_private_bfd_data _bfd_generic_bfd_copy_private_bfd_data
9deaaaf1
ILT
497#endif
498
2a01c351
KR
499#ifndef MY_bfd_merge_private_bfd_data
500#define MY_bfd_merge_private_bfd_data _bfd_generic_bfd_merge_private_bfd_data
501#endif
502
503#ifndef MY_bfd_copy_private_symbol_data
504#define MY_bfd_copy_private_symbol_data _bfd_generic_bfd_copy_private_symbol_data
505#endif
506
507#ifndef MY_bfd_print_private_bfd_data
508#define MY_bfd_print_private_bfd_data _bfd_generic_bfd_print_private_bfd_data
509#endif
510
511#ifndef MY_bfd_set_private_flags
512#define MY_bfd_set_private_flags _bfd_generic_bfd_set_private_flags
513#endif
514
9deaaaf1
ILT
515#ifndef MY_bfd_is_local_label
516#define MY_bfd_is_local_label bfd_generic_is_local_label
517#endif
518
519#ifndef MY_bfd_free_cached_info
5c8444f8
ILT
520#define MY_bfd_free_cached_info NAME(aout,bfd_free_cached_info)
521#endif
522
523#ifndef MY_close_and_cleanup
524#define MY_close_and_cleanup MY_bfd_free_cached_info
9deaaaf1
ILT
525#endif
526
f5419a59
ILT
527#ifndef MY_get_dynamic_symtab_upper_bound
528#define MY_get_dynamic_symtab_upper_bound \
529 _bfd_nodynamic_get_dynamic_symtab_upper_bound
530#endif
531#ifndef MY_canonicalize_dynamic_symtab
532#define MY_canonicalize_dynamic_symtab \
533 _bfd_nodynamic_canonicalize_dynamic_symtab
534#endif
535#ifndef MY_get_dynamic_reloc_upper_bound
536#define MY_get_dynamic_reloc_upper_bound \
537 _bfd_nodynamic_get_dynamic_reloc_upper_bound
538#endif
539#ifndef MY_canonicalize_dynamic_reloc
540#define MY_canonicalize_dynamic_reloc \
541 _bfd_nodynamic_canonicalize_dynamic_reloc
542#endif
543
294eaca4
SC
544/* Aout symbols normally have leading underscores */
545#ifndef MY_symbol_leading_char
546#define MY_symbol_leading_char '_'
582bc90a 547#endif
e98e6ec1 548
4c3721d5
ILT
549/* Aout archives normally use spaces for padding */
550#ifndef AR_PAD_CHAR
551#define AR_PAD_CHAR ' '
552#endif
553
554#ifndef MY_BFD_TARGET
a932d0ff 555const bfd_target MY(vec) =
e98e6ec1
SC
556{
557 TARGETNAME, /* name */
558 bfd_target_aout_flavour,
582bc90a 559#ifdef TARGET_IS_BIG_ENDIAN_P
64d5f5d0
ILT
560 BFD_ENDIAN_BIG, /* target byte order (big) */
561 BFD_ENDIAN_BIG, /* target headers byte order (big) */
582bc90a 562#else
64d5f5d0
ILT
563 BFD_ENDIAN_LITTLE, /* target byte order (little) */
564 BFD_ENDIAN_LITTLE, /* target headers byte order (little) */
582bc90a 565#endif
e98e6ec1
SC
566 (HAS_RELOC | EXEC_P | /* object flags */
567 HAS_LINENO | HAS_DEBUG |
57a1867e 568 HAS_SYMS | HAS_LOCALS | DYNAMIC | WP_TEXT | D_PAGED),
e98e6ec1 569 (SEC_HAS_CONTENTS | SEC_ALLOC | SEC_LOAD | SEC_RELOC), /* section flags */
294eaca4 570 MY_symbol_leading_char,
4c3721d5 571 AR_PAD_CHAR, /* ar_pad_char */
582bc90a 572 15, /* ar_max_namelen */
e98e6ec1 573#ifdef TARGET_IS_BIG_ENDIAN_P
4c3721d5
ILT
574 bfd_getb64, bfd_getb_signed_64, bfd_putb64,
575 bfd_getb32, bfd_getb_signed_32, bfd_putb32,
576 bfd_getb16, bfd_getb_signed_16, bfd_putb16, /* data */
577 bfd_getb64, bfd_getb_signed_64, bfd_putb64,
578 bfd_getb32, bfd_getb_signed_32, bfd_putb32,
579 bfd_getb16, bfd_getb_signed_16, bfd_putb16, /* hdrs */
e98e6ec1 580#else
4c3721d5
ILT
581 bfd_getl64, bfd_getl_signed_64, bfd_putl64,
582 bfd_getl32, bfd_getl_signed_32, bfd_putl32,
583 bfd_getl16, bfd_getl_signed_16, bfd_putl16, /* data */
584 bfd_getl64, bfd_getl_signed_64, bfd_putl64,
585 bfd_getl32, bfd_getl_signed_32, bfd_putl32,
586 bfd_getl16, bfd_getl_signed_16, bfd_putl16, /* hdrs */
e98e6ec1
SC
587#endif
588 {_bfd_dummy_target, MY_object_p, /* bfd_check_format */
589 bfd_generic_archive_p, MY_core_file_p},
590 {bfd_false, MY_mkobject, /* bfd_set_format */
591 _bfd_generic_mkarchive, bfd_false},
592 {bfd_false, MY_write_object_contents, /* bfd_write_contents */
593 _bfd_write_archive_contents, bfd_false},
594
6812b607
ILT
595 BFD_JUMP_TABLE_GENERIC (MY),
596 BFD_JUMP_TABLE_COPY (MY),
597 BFD_JUMP_TABLE_CORE (MY),
598 BFD_JUMP_TABLE_ARCHIVE (MY),
599 BFD_JUMP_TABLE_SYMBOLS (MY),
600 BFD_JUMP_TABLE_RELOCS (MY),
601 BFD_JUMP_TABLE_WRITE (MY),
602 BFD_JUMP_TABLE_LINK (MY),
f5419a59 603 BFD_JUMP_TABLE_DYNAMIC (MY),
6812b607 604
582bc90a 605 (PTR) MY_backend_data,
e98e6ec1 606};
4c3721d5 607#endif /* MY_BFD_TARGET */