* targets.c (bfd_target): Remove unused align_power_min field.
[binutils-gdb.git] / bfd / ptrace-core.c
index 5b07ea12d3c61ba7af98bc70f238a24cabfe01f0..e0b24733809f81c40e7a724f03593be22853cd17 100644 (file)
@@ -80,7 +80,7 @@ ptrace_unix_core_file_p (abfd)
       || u.pt_rev != _BCS_PTRACE_REV)
     {
       /* Too small to be a core file */
-      bfd_error = wrong_format;
+      bfd_set_error (bfd_error_wrong_format);
       return 0;
     }
 
@@ -92,7 +92,7 @@ ptrace_unix_core_file_p (abfd)
                bfd_zalloc (abfd, sizeof (struct trad_core_struct));
 
   if (rawptr == NULL) {
-    bfd_error = no_memory;
+    bfd_set_error (bfd_error_no_memory);
     return 0;
   }
   
@@ -103,10 +103,10 @@ ptrace_unix_core_file_p (abfd)
   /* Create the sections.  This is raunchy, but bfd_close wants to free
      them separately.  */
 
-  core_stacksec(abfd) = (asection *) zalloc (sizeof (asection));
+  core_stacksec(abfd) = (asection *) bfd_zmalloc (sizeof (asection));
   if (core_stacksec (abfd) == NULL) {
   loser:
-    bfd_error = no_memory;
+    bfd_set_error (bfd_error_no_memory);
     free ((void *)rawptr);
     return 0;
   }
@@ -189,76 +189,16 @@ ptrace_unix_core_file_matches_executable_p  (core_bfd, exec_bfd)
   return true;
 }
 \f
-/* No archive file support via this BFD */
-#define        ptrace_unix_openr_next_archived_file    bfd_generic_openr_next_archived_file
-#define        ptrace_unix_generic_stat_arch_elt               bfd_generic_stat_arch_elt
-#define        ptrace_unix_slurp_armap                 bfd_false
-#define        ptrace_unix_slurp_extended_name_table   bfd_true
-#define        ptrace_unix_write_armap                 (boolean (*) PARAMS     \
-    ((bfd *arch, unsigned int elength, struct orl *map, \
-      unsigned int orl_count, int stridx))) bfd_false
-#define        ptrace_unix_truncate_arname             bfd_dont_truncate_arname
-#define        aout_32_openr_next_archived_file        bfd_generic_openr_next_archived_file
-
-#define        ptrace_unix_close_and_cleanup           bfd_generic_close_and_cleanup
-#define        ptrace_unix_set_section_contents                (boolean (*) PARAMS     \
-        ((bfd *abfd, asection *section, PTR data, file_ptr offset,     \
-        bfd_size_type count))) bfd_false
-#define        ptrace_unix_get_section_contents                bfd_generic_get_section_contents
-#define        ptrace_unix_new_section_hook            (boolean (*) PARAMS     \
-       ((bfd *, sec_ptr))) bfd_true
-#define        ptrace_unix_get_symtab_upper_bound      bfd_0u
-#define        ptrace_unix_get_symtab                  (unsigned int (*) PARAMS \
-        ((bfd *, struct symbol_cache_entry **))) bfd_0u
-#define        ptrace_unix_get_reloc_upper_bound               (unsigned int (*) PARAMS \
-       ((bfd *, sec_ptr))) bfd_0u
-#define        ptrace_unix_canonicalize_reloc          (unsigned int (*) PARAMS \
-       ((bfd *, sec_ptr, arelent **, struct symbol_cache_entry**))) bfd_0u
-#define        ptrace_unix_make_empty_symbol           (struct symbol_cache_entry * \
-       (*) PARAMS ((bfd *))) bfd_false
-#define        ptrace_unix_print_symbol                        (void (*) PARAMS        \
-       ((bfd *, PTR, struct symbol_cache_entry  *,                     \
-       bfd_print_symbol_type))) bfd_false
-#define        ptrace_unix_get_symbol_info             (void (*) PARAMS        \
-       ((bfd *, struct symbol_cache_entry  *,                  \
-       symbol_info *))) bfd_false
-#define        ptrace_unix_get_lineno                  (alent * (*) PARAMS     \
-       ((bfd *, struct symbol_cache_entry *))) bfd_nullvoidptr
-#define        ptrace_unix_set_arch_mach                       (boolean (*) PARAMS     \
-       ((bfd *, enum bfd_architecture, unsigned long))) bfd_false
-#define        ptrace_unix_find_nearest_line           (boolean (*) PARAMS     \
-        ((bfd *abfd, struct sec  *section,                             \
-         struct symbol_cache_entry  **symbols,bfd_vma offset,          \
-         CONST char **file, CONST char **func, unsigned int *line))) bfd_false
-#define        ptrace_unix_sizeof_headers              (int (*) PARAMS \
-       ((bfd *, boolean))) bfd_0
-
-#define ptrace_unix_bfd_debug_info_start               bfd_void
-#define ptrace_unix_bfd_debug_info_end         bfd_void
-#define ptrace_unix_bfd_debug_info_accumulate  (void (*) PARAMS        \
-       ((bfd *, struct sec *))) bfd_void
-#define ptrace_unix_bfd_get_relocated_section_contents bfd_generic_get_relocated_section_contents
-#define ptrace_unix_bfd_relax_section          bfd_generic_relax_section
-#define ptrace_unix_bfd_reloc_type_lookup \
-  ((CONST struct reloc_howto_struct *(*) PARAMS ((bfd *, bfd_reloc_code_real_type))) bfd_nullvoidptr)
-#define ptrace_unix_bfd_make_debug_symbol \
-  ((asymbol *(*) PARAMS ((bfd *, void *, unsigned long))) bfd_nullvoidptr)
-#define ptrace_unix_bfd_link_hash_table_create \
-  ((struct bfd_link_hash_table *(*) PARAMS ((bfd *))) bfd_nullvoidptr)
-#define ptrace_unix_bfd_link_add_symbols \
-  ((boolean (*) PARAMS ((bfd *, struct bfd_link_info *))) bfd_false)
-#define ptrace_unix_bfd_final_link \
-  ((boolean (*) PARAMS ((bfd *, struct bfd_link_info *))) bfd_false)
-
 /* If somebody calls any byte-swapping routines, shoot them.  */
 void
 swap_abort()
 {
   abort(); /* This way doesn't require any declaration for ANSI to fuck up */
 }
-#define        NO_GET  ((bfd_vma (*) PARAMS ((         bfd_byte *))) swap_abort )
+#define        NO_GET  ((bfd_vma (*) PARAMS ((   const bfd_byte *))) swap_abort )
 #define        NO_PUT  ((void    (*) PARAMS ((bfd_vma, bfd_byte *))) swap_abort )
-#define        NO_SIGNED_GET ((bfd_signed_vma (*) PARAMS ((bfd_byte *))) swap_abort )
+#define        NO_SIGNED_GET \
+  ((bfd_signed_vma (*) PARAMS ((const bfd_byte *))) swap_abort )
 
 bfd_target ptrace_core_vec =
   {
@@ -296,7 +236,15 @@ bfd_target ptrace_core_vec =
      bfd_false, bfd_false
     },
     
-    JUMP_TABLE(ptrace_unix),
+       BFD_JUMP_TABLE_GENERIC (_bfd_generic),
+       BFD_JUMP_TABLE_COPY (_bfd_generic),
+       BFD_JUMP_TABLE_CORE (ptrace_unix),
+       BFD_JUMP_TABLE_ARCHIVE (_bfd_noarchive),
+       BFD_JUMP_TABLE_SYMBOLS (_bfd_nosymbols),
+       BFD_JUMP_TABLE_RELOCS (_bfd_norelocs),
+       BFD_JUMP_TABLE_WRITE (_bfd_generic),
+       BFD_JUMP_TABLE_LINK (_bfd_nolink),
+
     (PTR) 0                    /* backend_data */
 };