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