2004-05-27 Michael Chastain <mec.gnu@mindspring.com>
[deliverable/binutils-gdb.git] / bfd / aout-target.h
index a27c11be2d662b31eb66283beba2427fa68d08ed..fd344a45d599333043aed3a0ed1f72a6def97fee 100644 (file)
@@ -1,5 +1,6 @@
 /* Define a target vector and some small routines for a variant of a.out.
-   Copyright (C) 1990, 91, 92, 93, 94, 95, 96, 97, 98, 99, 2000
+   Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
+   2000, 2001, 2002, 2003, 2004
    Free Software Foundation, Inc.
 
 This file is part of BFD, the Binary File Descriptor library.
@@ -87,9 +88,9 @@ MY(callback) (abfd)
 
   /* Determine the architecture and machine type of the object file.  */
 #ifdef SET_ARCH_MACH
-  SET_ARCH_MACH(abfd, *execp);
+  SET_ARCH_MACH (abfd, *execp);
 #else
-  bfd_default_set_arch_mach(abfd, DEFAULT_ARCH, 0);
+  bfd_default_set_arch_mach (abfd, DEFAULT_ARCH, 0);
 #endif
 
   /* The number of relocation records.  This must be called after
@@ -145,13 +146,14 @@ MY(object_p) (abfd)
   struct external_exec exec_bytes;     /* Raw exec header from file */
   struct internal_exec exec;           /* Cleaned-up exec header */
   const bfd_target *target;
+  bfd_size_type amt = EXEC_BYTES_SIZE;
 
-  if (bfd_read ((PTR) &exec_bytes, 1, EXEC_BYTES_SIZE, abfd)
-      != EXEC_BYTES_SIZE) {
-    if (bfd_get_error () != bfd_error_system_call)
-      bfd_set_error (bfd_error_wrong_format);
-    return 0;
-  }
+  if (bfd_bread ((PTR) &exec_bytes, amt, abfd) != amt)
+    {
+      if (bfd_get_error () != bfd_error_system_call)
+       bfd_set_error (bfd_error_wrong_format);
+      return 0;
+    }
 
 #ifdef SWAP_MAGIC
   exec.a_info = SWAP_MAGIC (exec_bytes.e_info);
@@ -199,21 +201,21 @@ MY(object_p) (abfd)
 
 #ifndef MY_mkobject
 
-static boolean MY(mkobject) PARAMS ((bfd *));
+static bfd_boolean MY(mkobject) PARAMS ((bfd *));
 
-static boolean
+static bfd_boolean
 MY(mkobject) (abfd)
      bfd *abfd;
 {
-  if (NAME(aout,mkobject) (abfd) == false)
-    return false;
+  if (! NAME(aout,mkobject) (abfd))
+    return FALSE;
 #if 0 /* Sizes get set in set_sizes callback, later, after we know
         the architecture and machine.  */
   adata(abfd).page_size = TARGET_PAGE_SIZE;
   adata(abfd).segment_size = SEGMENT_SIZE;
   adata(abfd).exec_bytes_size = EXEC_BYTES_SIZE;
 #endif
-  return true;
+  return TRUE;
 }
 #define MY_mkobject MY(mkobject)
 #endif
@@ -226,10 +228,10 @@ MY(mkobject) (abfd)
    section contents, and copy_private_bfd_data is not called until
    after the section contents have been set.  */
 
-static boolean MY_bfd_copy_private_section_data
+static bfd_boolean MY_bfd_copy_private_section_data
   PARAMS ((bfd *, asection *, bfd *, asection *));
 
-static boolean
+static bfd_boolean
 MY_bfd_copy_private_section_data (ibfd, isec, obfd, osec)
      bfd *ibfd;
      asection *isec ATTRIBUTE_UNUSED;
@@ -239,7 +241,7 @@ MY_bfd_copy_private_section_data (ibfd, isec, obfd, osec)
   if (bfd_get_flavour (ibfd) == bfd_target_aout_flavour
       && bfd_get_flavour (obfd) == bfd_target_aout_flavour)
     obj_aout_subformat (obfd) = obj_aout_subformat (ibfd);
-  return true;
+  return TRUE;
 }
 
 #endif
@@ -249,7 +251,9 @@ MY_bfd_copy_private_section_data (ibfd, isec, obfd, osec)
    file header, symbols, and relocation.  */
 
 #ifndef MY_write_object_contents
-static boolean
+static bfd_boolean MY(write_object_contents) PARAMS ((bfd *));
+
+static bfd_boolean
 MY(write_object_contents) (abfd)
      bfd *abfd;
 {
@@ -260,16 +264,16 @@ MY(write_object_contents) (abfd)
 
   WRITE_HEADERS(abfd, execp);
 
-  return true;
+  return TRUE;
 }
 #define MY_write_object_contents MY(write_object_contents)
 #endif
 
 #ifndef MY_set_sizes
 
-static boolean MY(set_sizes) PARAMS ((bfd *));
+static bfd_boolean MY(set_sizes) PARAMS ((bfd *));
 
-static boolean
+static bfd_boolean
 MY(set_sizes) (abfd)
      bfd *abfd;
 {
@@ -283,7 +287,7 @@ MY(set_sizes) (abfd)
 #endif
 
   adata(abfd).exec_bytes_size = EXEC_BYTES_SIZE;
-  return true;
+  return TRUE;
 }
 #define MY_set_sizes MY(set_sizes)
 #endif
@@ -325,7 +329,7 @@ MY(set_sizes) (abfd)
 #define MY_finish_dynamic_link 0
 #endif
 
-static CONST struct aout_backend_data MY(backend_data) = {
+static const struct aout_backend_data MY(backend_data) = {
   MY_zmagic_contiguous,
   MY_text_includes_header,
   MY_entry_is_text_address,
@@ -371,9 +375,9 @@ MY_final_link_callback (abfd, ptreloff, pdreloff, psymoff)
 /* Final link routine.  We need to use a call back to get the correct
    offsets in the output file.  */
 
-static boolean MY_bfd_final_link PARAMS ((bfd *, struct bfd_link_info *));
+static bfd_boolean MY_bfd_final_link PARAMS ((bfd *, struct bfd_link_info *));
 
-static boolean
+static bfd_boolean
 MY_bfd_final_link (abfd, info)
      bfd *abfd;
      struct bfd_link_info *info;
@@ -439,7 +443,7 @@ MY_bfd_final_link (abfd, info)
 #endif
 #ifndef MY_bfd_debug_info_accumulate
 #define MY_bfd_debug_info_accumulate   \
-                       (void (*) PARAMS ((bfd*, struct sec *))) bfd_void
+               (void (*) PARAMS ((bfd*, struct bfd_section *))) bfd_void
 #endif
 
 #ifndef MY_core_file_failing_command
@@ -466,8 +470,8 @@ MY_bfd_final_link (abfd, info)
 #ifndef MY_get_symtab_upper_bound
 #define MY_get_symtab_upper_bound NAME(aout,get_symtab_upper_bound)
 #endif
-#ifndef MY_get_symtab
-#define MY_get_symtab NAME(aout,get_symtab)
+#ifndef MY_canonicalize_symtab
+#define MY_canonicalize_symtab NAME(aout,canonicalize_symtab)
 #endif
 #ifndef MY_get_reloc_upper_bound
 #define MY_get_reloc_upper_bound NAME(aout,get_reloc_upper_bound)
@@ -506,6 +510,15 @@ MY_bfd_final_link (abfd, info)
 #ifndef MY_bfd_gc_sections
 #define MY_bfd_gc_sections bfd_generic_gc_sections
 #endif
+#ifndef MY_bfd_merge_sections
+#define MY_bfd_merge_sections bfd_generic_merge_sections
+#endif
+#ifndef MY_bfd_is_group_section
+#define MY_bfd_is_group_section bfd_generic_is_group_section
+#endif
+#ifndef MY_bfd_discard_group
+#define MY_bfd_discard_group bfd_generic_discard_group
+#endif
 #ifndef MY_bfd_reloc_type_lookup
 #define MY_bfd_reloc_type_lookup NAME(aout,reloc_type_lookup)
 #endif
@@ -521,9 +534,15 @@ MY_bfd_final_link (abfd, info)
 #ifndef MY_bfd_link_hash_table_create
 #define MY_bfd_link_hash_table_create NAME(aout,link_hash_table_create)
 #endif
+#ifndef MY_bfd_link_hash_table_free
+#define MY_bfd_link_hash_table_free _bfd_generic_link_hash_table_free
+#endif
 #ifndef MY_bfd_link_add_symbols
 #define MY_bfd_link_add_symbols NAME(aout,link_add_symbols)
 #endif
+#ifndef MY_bfd_link_just_syms
+#define MY_bfd_link_just_syms _bfd_generic_link_just_syms
+#endif
 #ifndef MY_bfd_link_split_section
 #define MY_bfd_link_split_section  _bfd_generic_link_split_section
 #endif
@@ -540,6 +559,10 @@ MY_bfd_final_link (abfd, info)
 #define MY_bfd_copy_private_symbol_data _bfd_generic_bfd_copy_private_symbol_data
 #endif
 
+#ifndef MY_bfd_copy_private_header_data
+#define MY_bfd_copy_private_header_data _bfd_generic_bfd_copy_private_header_data
+#endif
+
 #ifndef MY_bfd_print_private_bfd_data
 #define MY_bfd_print_private_bfd_data _bfd_generic_bfd_print_private_bfd_data
 #endif
@@ -568,6 +591,10 @@ MY_bfd_final_link (abfd, info)
 #define MY_canonicalize_dynamic_symtab \
   _bfd_nodynamic_canonicalize_dynamic_symtab
 #endif
+#ifndef MY_get_synthetic_symtab
+#define MY_get_synthetic_symtab \
+  _bfd_nodynamic_get_synthetic_symtab
+#endif
 #ifndef MY_get_dynamic_reloc_upper_bound
 #define MY_get_dynamic_reloc_upper_bound \
   _bfd_nodynamic_get_dynamic_reloc_upper_bound
This page took 0.057467 seconds and 4 git commands to generate.