| 1 | /* Define a target vector and some small routines for a variant of a.out. |
| 2 | Copyright (C) 1990, 1991, 1992, 1993, 1994 Free Software Foundation, Inc. |
| 3 | |
| 4 | This file is part of BFD, the Binary File Descriptor library. |
| 5 | |
| 6 | This program is free software; you can redistribute it and/or modify |
| 7 | it under the terms of the GNU General Public License as published by |
| 8 | the Free Software Foundation; either version 2 of the License, or |
| 9 | (at your option) any later version. |
| 10 | |
| 11 | This program is distributed in the hope that it will be useful, |
| 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 14 | GNU General Public License for more details. |
| 15 | |
| 16 | You should have received a copy of the GNU General Public License |
| 17 | along with this program; if not, write to the Free Software |
| 18 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ |
| 19 | |
| 20 | #include "aout/aout64.h" |
| 21 | #include "aout/stab_gnu.h" |
| 22 | #include "aout/ar.h" |
| 23 | /*#include "libaout.h"*/ |
| 24 | |
| 25 | extern reloc_howto_type * NAME(aout,reloc_type_lookup) (); |
| 26 | |
| 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. */ |
| 29 | #ifndef MY_callback |
| 30 | static const bfd_target * |
| 31 | MY(callback) (abfd) |
| 32 | bfd *abfd; |
| 33 | { |
| 34 | struct internal_exec *execp = exec_hdr (abfd); |
| 35 | unsigned int arch_align_power; |
| 36 | unsigned long arch_align; |
| 37 | |
| 38 | /* Calculate the file positions of the parts of a newly read aout header */ |
| 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 | |
| 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 | |
| 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 | |
| 62 | /* Determine the architecture and machine type of the object file. */ |
| 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 | |
| 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 |
| 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 | } |
| 88 | |
| 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 |
| 92 | adata(abfd).page_size = TARGET_PAGE_SIZE; |
| 93 | #ifdef SEGMENT_SIZE |
| 94 | adata(abfd).segment_size = SEGMENT_SIZE; |
| 95 | #else |
| 96 | adata(abfd).segment_size = TARGET_PAGE_SIZE; |
| 97 | #endif |
| 98 | adata(abfd).exec_bytes_size = EXEC_BYTES_SIZE; |
| 99 | #endif |
| 100 | |
| 101 | return abfd->xvec; |
| 102 | } |
| 103 | #endif |
| 104 | |
| 105 | #ifndef MY_object_p |
| 106 | /* Finish up the reading of an a.out file header */ |
| 107 | |
| 108 | static const bfd_target * |
| 109 | MY(object_p) (abfd) |
| 110 | bfd *abfd; |
| 111 | { |
| 112 | struct external_exec exec_bytes; /* Raw exec header from file */ |
| 113 | struct internal_exec exec; /* Cleaned-up exec header */ |
| 114 | const bfd_target *target; |
| 115 | |
| 116 | if (bfd_read ((PTR) &exec_bytes, 1, EXEC_BYTES_SIZE, abfd) |
| 117 | != EXEC_BYTES_SIZE) { |
| 118 | if (bfd_get_error () != bfd_error_system_call) |
| 119 | bfd_set_error (bfd_error_wrong_format); |
| 120 | return 0; |
| 121 | } |
| 122 | |
| 123 | #ifdef SWAP_MAGIC |
| 124 | exec.a_info = SWAP_MAGIC (exec_bytes.e_info); |
| 125 | #else |
| 126 | exec.a_info = bfd_h_get_32 (abfd, exec_bytes.e_info); |
| 127 | #endif /* SWAP_MAGIC */ |
| 128 | |
| 129 | if (N_BADMAG (exec)) return 0; |
| 130 | #ifdef MACHTYPE_OK |
| 131 | if (!(MACHTYPE_OK (N_MACHTYPE (exec)))) return 0; |
| 132 | #endif |
| 133 | |
| 134 | NAME(aout,swap_exec_header_in)(abfd, &exec_bytes, &exec); |
| 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 | |
| 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 |
| 169 | static boolean |
| 170 | MY(mkobject) (abfd) |
| 171 | bfd *abfd; |
| 172 | { |
| 173 | if (NAME(aout,mkobject)(abfd) == false) |
| 174 | return false; |
| 175 | #if 0 /* Sizes get set in set_sizes callback, later, after we know |
| 176 | the architecture and machine. */ |
| 177 | adata(abfd).page_size = TARGET_PAGE_SIZE; |
| 178 | #ifdef SEGMENT_SIZE |
| 179 | adata(abfd).segment_size = SEGMENT_SIZE; |
| 180 | #else |
| 181 | adata(abfd).segment_size = TARGET_PAGE_SIZE; |
| 182 | #endif |
| 183 | adata(abfd).exec_bytes_size = EXEC_BYTES_SIZE; |
| 184 | #endif |
| 185 | return true; |
| 186 | } |
| 187 | #define MY_mkobject MY(mkobject) |
| 188 | #endif |
| 189 | |
| 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 |
| 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. */ |
| 197 | |
| 198 | /*ARGSUSED*/ |
| 199 | static boolean |
| 200 | MY_bfd_copy_private_section_data (ibfd, isec, obfd, osec) |
| 201 | bfd *ibfd; |
| 202 | asection *isec; |
| 203 | bfd *obfd; |
| 204 | asection *osec; |
| 205 | { |
| 206 | if (bfd_get_flavour (obfd) == bfd_target_aout_flavour) |
| 207 | obj_aout_subformat (obfd) = obj_aout_subformat (ibfd); |
| 208 | return true; |
| 209 | } |
| 210 | |
| 211 | #endif |
| 212 | |
| 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 |
| 218 | static boolean |
| 219 | MY(write_object_contents) (abfd) |
| 220 | bfd *abfd; |
| 221 | { |
| 222 | struct external_exec exec_bytes; |
| 223 | struct internal_exec *execp = exec_hdr (abfd); |
| 224 | |
| 225 | #if CHOOSE_RELOC_SIZE |
| 226 | CHOOSE_RELOC_SIZE(abfd); |
| 227 | #else |
| 228 | obj_reloc_entry_size (abfd) = RELOC_STD_SIZE; |
| 229 | #endif |
| 230 | |
| 231 | WRITE_HEADERS(abfd, execp); |
| 232 | |
| 233 | return true; |
| 234 | } |
| 235 | #define MY_write_object_contents MY(write_object_contents) |
| 236 | #endif |
| 237 | |
| 238 | #ifndef MY_set_sizes |
| 239 | static boolean |
| 240 | MY(set_sizes) (abfd) |
| 241 | bfd *abfd; |
| 242 | { |
| 243 | adata(abfd).page_size = TARGET_PAGE_SIZE; |
| 244 | |
| 245 | #ifdef SEGMENT_SIZE |
| 246 | adata(abfd).segment_size = SEGMENT_SIZE; |
| 247 | #else |
| 248 | adata(abfd).segment_size = TARGET_PAGE_SIZE; |
| 249 | #endif |
| 250 | |
| 251 | #ifdef ZMAGIC_DISK_BLOCK_SIZE |
| 252 | adata(abfd).zmagic_disk_block_size = ZMAGIC_DISK_BLOCK_SIZE; |
| 253 | #else |
| 254 | adata(abfd).zmagic_disk_block_size = TARGET_PAGE_SIZE; |
| 255 | #endif |
| 256 | |
| 257 | adata(abfd).exec_bytes_size = EXEC_BYTES_SIZE; |
| 258 | return true; |
| 259 | } |
| 260 | #define MY_set_sizes MY(set_sizes) |
| 261 | #endif |
| 262 | |
| 263 | #ifndef MY_exec_hdr_flags |
| 264 | #define MY_exec_hdr_flags 0 |
| 265 | #endif |
| 266 | |
| 267 | #ifndef MY_backend_data |
| 268 | |
| 269 | #ifndef MY_zmagic_contiguous |
| 270 | #define MY_zmagic_contiguous 0 |
| 271 | #endif |
| 272 | #ifndef MY_text_includes_header |
| 273 | #define MY_text_includes_header 0 |
| 274 | #endif |
| 275 | #ifndef MY_exec_header_not_counted |
| 276 | #define MY_exec_header_not_counted 0 |
| 277 | #endif |
| 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 |
| 292 | #endif |
| 293 | #ifndef MY_finish_dynamic_link |
| 294 | #define MY_finish_dynamic_link 0 |
| 295 | #endif |
| 296 | |
| 297 | static CONST struct aout_backend_data MY(backend_data) = { |
| 298 | MY_zmagic_contiguous, |
| 299 | MY_text_includes_header, |
| 300 | MY_exec_hdr_flags, |
| 301 | 0, /* text vma? */ |
| 302 | MY_set_sizes, |
| 303 | MY_exec_header_not_counted, |
| 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 |
| 310 | }; |
| 311 | #define MY_backend_data &MY(backend_data) |
| 312 | #endif |
| 313 | |
| 314 | #ifndef MY_final_link_callback |
| 315 | |
| 316 | /* Callback for the final_link routine to set the section offsets. */ |
| 317 | |
| 318 | static void MY_final_link_callback |
| 319 | PARAMS ((bfd *, file_ptr *, file_ptr *, file_ptr *)); |
| 320 | |
| 321 | static void |
| 322 | MY_final_link_callback (abfd, ptreloff, pdreloff, psymoff) |
| 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 | |
| 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 | |
| 342 | static boolean |
| 343 | MY_bfd_final_link (abfd, info) |
| 344 | bfd *abfd; |
| 345 | struct bfd_link_info *info; |
| 346 | { |
| 347 | return NAME(aout,final_link) (abfd, info, MY_final_link_callback); |
| 348 | } |
| 349 | |
| 350 | #endif |
| 351 | |
| 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 |
| 356 | #ifndef MY_get_elt_at_index |
| 357 | #define MY_get_elt_at_index _bfd_generic_get_elt_at_index |
| 358 | #endif |
| 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 |
| 366 | #define MY_slurp_extended_name_table _bfd_slurp_extended_name_table |
| 367 | #endif |
| 368 | #ifndef MY_construct_extended_name_table |
| 369 | #define MY_construct_extended_name_table \ |
| 370 | _bfd_archive_bsd_construct_extended_name_table |
| 371 | #endif |
| 372 | #ifndef MY_write_armap |
| 373 | #define MY_write_armap bsd_write_armap |
| 374 | #endif |
| 375 | #ifndef MY_read_ar_hdr |
| 376 | #define MY_read_ar_hdr _bfd_generic_read_ar_hdr |
| 377 | #endif |
| 378 | #ifndef MY_truncate_arname |
| 379 | #define MY_truncate_arname bfd_bsd_truncate_arname |
| 380 | #endif |
| 381 | #ifndef MY_update_armap_timestamp |
| 382 | #define MY_update_armap_timestamp _bfd_archive_bsd_update_armap_timestamp |
| 383 | #endif |
| 384 | |
| 385 | /* No core file defined here -- configure in trad-core.c separately. */ |
| 386 | #ifndef MY_core_file_failing_command |
| 387 | #define MY_core_file_failing_command _bfd_nocore_core_file_failing_command |
| 388 | #endif |
| 389 | #ifndef MY_core_file_failing_signal |
| 390 | #define MY_core_file_failing_signal _bfd_nocore_core_file_failing_signal |
| 391 | #endif |
| 392 | #ifndef MY_core_file_matches_executable_p |
| 393 | #define MY_core_file_matches_executable_p \ |
| 394 | _bfd_nocore_core_file_matches_executable_p |
| 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 |
| 407 | #define MY_bfd_debug_info_accumulate \ |
| 408 | (void (*) PARAMS ((bfd*, struct sec *))) bfd_void |
| 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 |
| 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 |
| 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 |
| 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 |
| 450 | #ifndef MY_get_symbol_info |
| 451 | #define MY_get_symbol_info NAME(aout,get_symbol_info) |
| 452 | #endif |
| 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 |
| 459 | #ifndef MY_find_nearest_line |
| 460 | #define MY_find_nearest_line NAME(aout,find_nearest_line) |
| 461 | #endif |
| 462 | #ifndef MY_sizeof_headers |
| 463 | #define MY_sizeof_headers NAME(aout,sizeof_headers) |
| 464 | #endif |
| 465 | #ifndef MY_bfd_get_relocated_section_contents |
| 466 | #define MY_bfd_get_relocated_section_contents \ |
| 467 | bfd_generic_get_relocated_section_contents |
| 468 | #endif |
| 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) |
| 474 | #endif |
| 475 | #ifndef MY_bfd_make_debug_symbol |
| 476 | #define MY_bfd_make_debug_symbol 0 |
| 477 | #endif |
| 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 |
| 484 | #ifndef MY_bfd_link_hash_table_create |
| 485 | #define MY_bfd_link_hash_table_create NAME(aout,link_hash_table_create) |
| 486 | #endif |
| 487 | #ifndef MY_bfd_link_add_symbols |
| 488 | #define MY_bfd_link_add_symbols NAME(aout,link_add_symbols) |
| 489 | #endif |
| 490 | #ifndef MY_bfd_link_split_section |
| 491 | #define MY_bfd_link_split_section _bfd_generic_link_split_section |
| 492 | #endif |
| 493 | |
| 494 | |
| 495 | #ifndef MY_bfd_copy_private_bfd_data |
| 496 | #define MY_bfd_copy_private_bfd_data _bfd_generic_bfd_copy_private_bfd_data |
| 497 | #endif |
| 498 | |
| 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 | |
| 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 |
| 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 |
| 525 | #endif |
| 526 | |
| 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 | |
| 544 | /* Aout symbols normally have leading underscores */ |
| 545 | #ifndef MY_symbol_leading_char |
| 546 | #define MY_symbol_leading_char '_' |
| 547 | #endif |
| 548 | |
| 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 |
| 555 | const bfd_target MY(vec) = |
| 556 | { |
| 557 | TARGETNAME, /* name */ |
| 558 | bfd_target_aout_flavour, |
| 559 | #ifdef TARGET_IS_BIG_ENDIAN_P |
| 560 | BFD_ENDIAN_BIG, /* target byte order (big) */ |
| 561 | BFD_ENDIAN_BIG, /* target headers byte order (big) */ |
| 562 | #else |
| 563 | BFD_ENDIAN_LITTLE, /* target byte order (little) */ |
| 564 | BFD_ENDIAN_LITTLE, /* target headers byte order (little) */ |
| 565 | #endif |
| 566 | (HAS_RELOC | EXEC_P | /* object flags */ |
| 567 | HAS_LINENO | HAS_DEBUG | |
| 568 | HAS_SYMS | HAS_LOCALS | DYNAMIC | WP_TEXT | D_PAGED), |
| 569 | (SEC_HAS_CONTENTS | SEC_ALLOC | SEC_LOAD | SEC_RELOC), /* section flags */ |
| 570 | MY_symbol_leading_char, |
| 571 | AR_PAD_CHAR, /* ar_pad_char */ |
| 572 | 15, /* ar_max_namelen */ |
| 573 | #ifdef TARGET_IS_BIG_ENDIAN_P |
| 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 */ |
| 580 | #else |
| 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 */ |
| 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 | |
| 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), |
| 603 | BFD_JUMP_TABLE_DYNAMIC (MY), |
| 604 | |
| 605 | (PTR) MY_backend_data, |
| 606 | }; |
| 607 | #endif /* MY_BFD_TARGET */ |