* syms.c (_bfd_generic_make_empty_symbol): New function.
authorAlan Modra <amodra@gmail.com>
Sun, 6 Jan 2002 07:30:35 +0000 (07:30 +0000)
committerAlan Modra <amodra@gmail.com>
Sun, 6 Jan 2002 07:30:35 +0000 (07:30 +0000)
* libbfd-in.h (_bfd_nosymbols_make_empty_symbol): Define as
_bfd_generic_make_empty_symbol.
* libbfd.h: Regenerate.
* bfd-in2.h: Regenerate.
* hppabsd-core.c (hppabsd_core_make_empty_symbol): Delete function.
(hppabsd_core_get_symtab_upper_bound): Don't define.
(hppabsd_core_get_symtab): Likewise.
(hppabsd_core_print_symbol): Likewise.
(hppabsd_core_get_symbol_info): Likewise.
(hppabsd_core_bfd_is_local_label_name): Likewise.
(hppabsd_core_get_lineno): Likewise.
(hppabsd_core_find_nearest_line): Likewise.
(hppabsd_core_bfd_make_debug_symbol): Likewise.
(hppabsd_core_read_minisymbols): Likewise.
(hppabsd_core_minisymbol_to_symbol): Likewise.
(hppabsd_core_vec): Use BFD_JUMP_TABLE_SYMBOLS (_bfd_nosymbols).
Formatting fixes.
* hpux-core.c: Similarly.
* irix-core.c: Similarly.
* osf-core.c: Similarly.
* sco5-core.c: Similarly.
* binary.c (binary_make_empty_symbol): Remove function, define as
_bfd_generic_make_empty_symbol.
* ihex.c (ihex_make_empty_symbol): Likewise.
* mmo.c (mmo_make_empty_symbol): Likewise.
* ppcboot.c (ppcboot_make_empty_symbol): Likewise.
* srec.c (srec_make_empty_symbol): Likewise.
* versados.c (versados_make_empty_symbol): Likewise.
* vms.c (_bfd_vms_make_empty_symbol): Remove.
(vms_make_empty_symbol): Define as _bfd_generic_make_empty_symbol.
* vms-gsd.c (_bfd_vms_slurp_gsd): Call bfd_make_empty_symbol
rather than _bfd_vms_make_empty_symbol.
* vms-misc.c (new_symbol): Likewise.

19 files changed:
bfd/ChangeLog
bfd/bfd-in2.h
bfd/binary.c
bfd/hppabsd-core.c
bfd/hpux-core.c
bfd/ihex.c
bfd/irix-core.c
bfd/libbfd-in.h
bfd/libbfd.h
bfd/mmo.c
bfd/osf-core.c
bfd/ppcboot.c
bfd/sco5-core.c
bfd/srec.c
bfd/syms.c
bfd/versados.c
bfd/vms-gsd.c
bfd/vms-misc.c
bfd/vms.c

index be4fe732a6c03b15836247bbcf8862a2d5c81873..06434355ddf9cafec813923928a86af203a1d3e6 100644 (file)
@@ -1,3 +1,40 @@
+2002-01-06  Alan Modra  <amodra@bigpond.net.au>
+
+       * syms.c (_bfd_generic_make_empty_symbol): New function.
+       * libbfd-in.h (_bfd_nosymbols_make_empty_symbol): Define as
+       _bfd_generic_make_empty_symbol.
+       * libbfd.h: Regenerate.
+       * bfd-in2.h: Regenerate.
+       * hppabsd-core.c (hppabsd_core_make_empty_symbol): Delete function.
+       (hppabsd_core_get_symtab_upper_bound): Don't define.
+       (hppabsd_core_get_symtab): Likewise.
+       (hppabsd_core_print_symbol): Likewise.
+       (hppabsd_core_get_symbol_info): Likewise.
+       (hppabsd_core_bfd_is_local_label_name): Likewise.
+       (hppabsd_core_get_lineno): Likewise.
+       (hppabsd_core_find_nearest_line): Likewise.
+       (hppabsd_core_bfd_make_debug_symbol): Likewise.
+       (hppabsd_core_read_minisymbols): Likewise.
+       (hppabsd_core_minisymbol_to_symbol): Likewise.
+       (hppabsd_core_vec): Use BFD_JUMP_TABLE_SYMBOLS (_bfd_nosymbols).
+       Formatting fixes.
+       * hpux-core.c: Similarly.
+       * irix-core.c: Similarly.
+       * osf-core.c: Similarly.
+       * sco5-core.c: Similarly.
+       * binary.c (binary_make_empty_symbol): Remove function, define as
+       _bfd_generic_make_empty_symbol.
+       * ihex.c (ihex_make_empty_symbol): Likewise.
+       * mmo.c (mmo_make_empty_symbol): Likewise.
+       * ppcboot.c (ppcboot_make_empty_symbol): Likewise.
+       * srec.c (srec_make_empty_symbol): Likewise.
+       * versados.c (versados_make_empty_symbol): Likewise.
+       * vms.c (_bfd_vms_make_empty_symbol): Remove.
+       (vms_make_empty_symbol): Define as _bfd_generic_make_empty_symbol.
+       * vms-gsd.c (_bfd_vms_slurp_gsd): Call bfd_make_empty_symbol
+       rather than _bfd_vms_make_empty_symbol.
+       * vms-misc.c (new_symbol): Likewise.
+
 2002-01-05  Alan Modra  <amodra@bigpond.net.au>
 
        * section.c (bfd_section_init): Remove unnecessary initialisations.
index 95a3d2e35bcf73fb1365a5d2aeaffd253db93883..e48a20d7c077fc2006e2c4777c0720f82b9f809f 100644 (file)
@@ -3110,6 +3110,9 @@ bfd_print_symbol_vandf PARAMS ((bfd *abfd, PTR file, asymbol *symbol));
 
 #define bfd_make_empty_symbol(abfd) \
      BFD_SEND (abfd, _bfd_make_empty_symbol, (abfd))
+asymbol *
+_bfd_generic_make_empty_symbol PARAMS ((bfd *));
+
 #define bfd_make_debug_symbol(abfd,ptr,size) \
         BFD_SEND (abfd, _bfd_make_debug_symbol, (abfd, ptr, size))
 int
index 7b66f309014feb1ecc4f499347bda6f451bffec9..705ac8fe260ad231d6aa60ef780a317ea6f3faa7 100644 (file)
@@ -48,7 +48,6 @@ static boolean binary_get_section_contents
 static long binary_get_symtab_upper_bound PARAMS ((bfd *));
 static char *mangle_name PARAMS ((bfd *, char *));
 static long binary_get_symtab PARAMS ((bfd *, asymbol **));
-static asymbol *binary_make_empty_symbol PARAMS ((bfd *));
 static void binary_get_symbol_info PARAMS ((bfd *, asymbol *, symbol_info *));
 static boolean binary_set_section_contents
   PARAMS ((bfd *, asection *, PTR, file_ptr, bfd_size_type));
@@ -219,15 +218,7 @@ binary_get_symtab (abfd, alocation)
   return BIN_SYMS;
 }
 
-/* Make an empty symbol.  */
-
-static asymbol *
-binary_make_empty_symbol (abfd)
-     bfd *abfd;
-{
-  return (asymbol *) bfd_alloc (abfd, (bfd_size_type) sizeof (asymbol));
-}
-
+#define binary_make_empty_symbol _bfd_generic_make_empty_symbol
 #define binary_print_symbol _bfd_nosymbols_print_symbol
 
 /* Get information about a symbol.  */
index 3fb76cc439c7d2b81f444c3e49deef5d335bf24c..4ae6315157b5ee858a26147b8e9d9d590a697e2f 100644 (file)
@@ -51,7 +51,6 @@
 static asection *make_bfd_asection PARAMS ((bfd *, const char *,
                                            flagword, bfd_size_type,
                                            file_ptr, unsigned int));
-static asymbol *hppabsd_core_make_empty_symbol PARAMS ((bfd *));
 static const bfd_target *hppabsd_core_core_file_p PARAMS ((bfd *));
 static char *hppabsd_core_core_file_failing_command PARAMS ((bfd *));
 static int hppabsd_core_core_file_failing_signal PARAMS ((bfd *));
@@ -100,18 +99,6 @@ make_bfd_asection (abfd, name, flags, _raw_size, offset, alignment_power)
   return asect;
 }
 
-static asymbol *
-hppabsd_core_make_empty_symbol (abfd)
-     bfd *abfd;
-{
-  asymbol *new;
-
-  new = (asymbol *) bfd_zalloc (abfd, (bfd_size_type) sizeof (asymbol));
-  if (new)
-    new->the_bfd = abfd;
-  return new;
-}
-
 static const bfd_target *
 hppabsd_core_core_file_p (abfd)
      bfd *abfd;
@@ -239,19 +226,6 @@ hppabsd_core_core_file_matches_executable_p (core_bfd, exec_bfd)
   return true;
 }
 \f
-#define hppabsd_core_get_symtab_upper_bound \
-  _bfd_nosymbols_get_symtab_upper_bound
-#define hppabsd_core_get_symtab _bfd_nosymbols_get_symtab
-#define hppabsd_core_print_symbol _bfd_nosymbols_print_symbol
-#define hppabsd_core_get_symbol_info _bfd_nosymbols_get_symbol_info
-#define hppabsd_core_bfd_is_local_label_name \
-  _bfd_nosymbols_bfd_is_local_label_name
-#define hppabsd_core_get_lineno _bfd_nosymbols_get_lineno
-#define hppabsd_core_find_nearest_line _bfd_nosymbols_find_nearest_line
-#define hppabsd_core_bfd_make_debug_symbol _bfd_nosymbols_bfd_make_debug_symbol
-#define hppabsd_core_read_minisymbols _bfd_nosymbols_read_minisymbols
-#define hppabsd_core_minisymbol_to_symbol _bfd_nosymbols_minisymbol_to_symbol
-
 /* If somebody calls any byte-swapping routines, shoot them.  */
 static void
 swap_abort ()
@@ -300,15 +274,15 @@ const bfd_target hppabsd_core_vec =
      bfd_false, bfd_false
     },
 
-       BFD_JUMP_TABLE_GENERIC (_bfd_generic),
-       BFD_JUMP_TABLE_COPY (_bfd_generic),
-       BFD_JUMP_TABLE_CORE (hppabsd_core),
-       BFD_JUMP_TABLE_ARCHIVE (_bfd_noarchive),
-       BFD_JUMP_TABLE_SYMBOLS (hppabsd_core),
-       BFD_JUMP_TABLE_RELOCS (_bfd_norelocs),
-       BFD_JUMP_TABLE_WRITE (_bfd_generic),
-       BFD_JUMP_TABLE_LINK (_bfd_nolink),
-       BFD_JUMP_TABLE_DYNAMIC (_bfd_nodynamic),
+    BFD_JUMP_TABLE_GENERIC (_bfd_generic),
+    BFD_JUMP_TABLE_COPY (_bfd_generic),
+    BFD_JUMP_TABLE_CORE (hppabsd_core),
+    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),
+    BFD_JUMP_TABLE_DYNAMIC (_bfd_nodynamic),
 
     NULL,
 
index a8360228eb681bd61e4a5571ab87332a87553858..81d85eaa221eb3e1ec20cf72e369e610eb61c692 100644 (file)
@@ -103,7 +103,6 @@ struct hpux_core_struct
 static asection *make_bfd_asection
   PARAMS ((bfd *, const char *, flagword, bfd_size_type, bfd_vma,
           unsigned int));
-static asymbol *hpux_core_make_empty_symbol PARAMS ((bfd *));
 static const bfd_target *hpux_core_core_file_p PARAMS ((bfd *));
 static char *hpux_core_core_file_failing_command PARAMS ((bfd *));
 static int hpux_core_core_file_failing_signal PARAMS ((bfd *));
@@ -142,18 +141,6 @@ make_bfd_asection (abfd, name, flags, _raw_size, vma, alignment_power)
   return asect;
 }
 
-static asymbol *
-hpux_core_make_empty_symbol (abfd)
-     bfd *abfd;
-{
-  asymbol *new;
-
-  new = (asymbol *) bfd_zalloc (abfd, (bfd_size_type) sizeof (asymbol));
-  if (new)
-    new->the_bfd = abfd;
-  return new;
-}
-
 /* this function builds a bfd target if the file is a corefile.
    It returns null or 0 if it finds out thaat it is not a core file.
    The way it checks this is by looking for allowed 'type' field values.
@@ -353,18 +340,6 @@ hpux_core_core_file_matches_executable_p (core_bfd, exec_bfd)
   return true;                 /* FIXME, We have no way of telling at this point */
 }
 \f
-#define hpux_core_get_symtab_upper_bound _bfd_nosymbols_get_symtab_upper_bound
-#define hpux_core_get_symtab _bfd_nosymbols_get_symtab
-#define hpux_core_print_symbol _bfd_nosymbols_print_symbol
-#define hpux_core_get_symbol_info _bfd_nosymbols_get_symbol_info
-#define hpux_core_bfd_is_local_label_name \
-  _bfd_nosymbols_bfd_is_local_label_name
-#define hpux_core_get_lineno _bfd_nosymbols_get_lineno
-#define hpux_core_find_nearest_line _bfd_nosymbols_find_nearest_line
-#define hpux_core_bfd_make_debug_symbol _bfd_nosymbols_bfd_make_debug_symbol
-#define hpux_core_read_minisymbols _bfd_nosymbols_read_minisymbols
-#define hpux_core_minisymbol_to_symbol _bfd_nosymbols_minisymbol_to_symbol
-
 /* If somebody calls any byte-swapping routines, shoot them.  */
 static void
 swap_abort ()
@@ -411,15 +386,15 @@ const bfd_target hpux_core_vec =
      bfd_false, bfd_false
     },
 
-       BFD_JUMP_TABLE_GENERIC (_bfd_generic),
-       BFD_JUMP_TABLE_COPY (_bfd_generic),
-       BFD_JUMP_TABLE_CORE (hpux_core),
-       BFD_JUMP_TABLE_ARCHIVE (_bfd_noarchive),
-       BFD_JUMP_TABLE_SYMBOLS (hpux_core),
-       BFD_JUMP_TABLE_RELOCS (_bfd_norelocs),
-       BFD_JUMP_TABLE_WRITE (_bfd_generic),
-       BFD_JUMP_TABLE_LINK (_bfd_nolink),
-       BFD_JUMP_TABLE_DYNAMIC (_bfd_nodynamic),
+    BFD_JUMP_TABLE_GENERIC (_bfd_generic),
+    BFD_JUMP_TABLE_COPY (_bfd_generic),
+    BFD_JUMP_TABLE_CORE (hpux_core),
+    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),
+    BFD_JUMP_TABLE_DYNAMIC (_bfd_nodynamic),
 
     NULL,
 
index 9aacdfce4d5b9701417cf85baca0216634ff42b6..8bb51349f0729f02ad3e028763f311952551e31d 100644 (file)
@@ -1,5 +1,5 @@
 /* BFD back-end for Intel Hex objects.
-   Copyright 1995, 1996, 1998, 1999, 2000, 2001
+   Copyright 1995, 1996, 1998, 1999, 2000, 2001, 2002
    Free Software Foundation, Inc.
    Written by Ian Lance Taylor of Cygnus Support <ian@cygnus.com>.
 
@@ -139,7 +139,6 @@ static boolean ihex_set_section_contents
 static boolean ihex_write_record
   PARAMS ((bfd *, size_t, unsigned int, unsigned int, bfd_byte *));
 static boolean ihex_write_object_contents PARAMS ((bfd *));
-static asymbol *ihex_make_empty_symbol PARAMS ((bfd *));
 static boolean ihex_set_arch_mach
   PARAMS ((bfd *, enum bfd_architecture, unsigned long));
 static int ihex_sizeof_headers PARAMS ((bfd *, boolean));
@@ -916,21 +915,6 @@ ihex_write_object_contents (abfd)
   return true;
 }
 
-/* Make an empty symbol.  This is required only because
-   bfd_make_section_anyway wants to create a symbol for the section.  */
-
-static asymbol *
-ihex_make_empty_symbol (abfd)
-     bfd *abfd;
-{
-  asymbol *new;
-
-  new = (asymbol *) bfd_zalloc (abfd, (bfd_size_type) sizeof (asymbol));
-  if (new != NULL)
-    new->the_bfd = abfd;
-  return new;
-}
-
 /* Set the architecture for the output file.  The architecture is
    irrelevant, so we ignore errors about unknown architectures.  */
 
@@ -970,6 +954,7 @@ ihex_sizeof_headers (abfd, exec)
 #define ihex_get_symtab_upper_bound bfd_0l
 #define ihex_get_symtab \
   ((long (*) PARAMS ((bfd *, asymbol **))) bfd_0l)
+#define ihex_make_empty_symbol _bfd_generic_make_empty_symbol
 #define ihex_print_symbol _bfd_nosymbols_print_symbol
 #define ihex_get_symbol_info _bfd_nosymbols_get_symbol_info
 #define ihex_bfd_is_local_label_name _bfd_nosymbols_bfd_is_local_label_name
index c1a99acd52500e08f907095365041bf8d3f07e23..0e48a9aa681e5b40e6c68cd5dc399ac8f44237fc 100644 (file)
@@ -48,7 +48,6 @@ static char *irix_core_core_file_failing_command PARAMS ((bfd *));
 static int irix_core_core_file_failing_signal PARAMS ((bfd *));
 static boolean irix_core_core_file_matches_executable_p
   PARAMS ((bfd *, bfd *));
-static asymbol *irix_core_make_empty_symbol PARAMS ((bfd *));
 static void swap_abort PARAMS ((void));
 
 static asection *
@@ -203,29 +202,6 @@ irix_core_core_file_matches_executable_p (core_bfd, exec_bfd)
   return true;                 /* XXX - FIXME */
 }
 
-static asymbol *
-irix_core_make_empty_symbol (abfd)
-     bfd *abfd;
-{
-  bfd_size_type amt = sizeof (asymbol);
-  asymbol *new = (asymbol *) bfd_zalloc (abfd, amt);
-  if (new)
-    new->the_bfd = abfd;
-  return new;
-}
-
-#define irix_core_get_symtab_upper_bound _bfd_nosymbols_get_symtab_upper_bound
-#define irix_core_get_symtab _bfd_nosymbols_get_symtab
-#define irix_core_print_symbol _bfd_nosymbols_print_symbol
-#define irix_core_get_symbol_info _bfd_nosymbols_get_symbol_info
-#define irix_core_bfd_is_local_label_name \
-  _bfd_nosymbols_bfd_is_local_label_name
-#define irix_core_get_lineno _bfd_nosymbols_get_lineno
-#define irix_core_find_nearest_line _bfd_nosymbols_find_nearest_line
-#define irix_core_bfd_make_debug_symbol _bfd_nosymbols_bfd_make_debug_symbol
-#define irix_core_read_minisymbols _bfd_nosymbols_read_minisymbols
-#define irix_core_minisymbol_to_symbol _bfd_nosymbols_minisymbol_to_symbol
-
 /* If somebody calls any byte-swapping routines, shoot them.  */
 static void
 swap_abort()
@@ -272,15 +248,15 @@ const bfd_target irix_core_vec =
      bfd_false, bfd_false
     },
 
-       BFD_JUMP_TABLE_GENERIC (_bfd_generic),
-       BFD_JUMP_TABLE_COPY (_bfd_generic),
-       BFD_JUMP_TABLE_CORE (irix_core),
-       BFD_JUMP_TABLE_ARCHIVE (_bfd_noarchive),
-       BFD_JUMP_TABLE_SYMBOLS (irix_core),
-       BFD_JUMP_TABLE_RELOCS (_bfd_norelocs),
-       BFD_JUMP_TABLE_WRITE (_bfd_generic),
-       BFD_JUMP_TABLE_LINK (_bfd_nolink),
-       BFD_JUMP_TABLE_DYNAMIC (_bfd_nodynamic),
+    BFD_JUMP_TABLE_GENERIC (_bfd_generic),
+    BFD_JUMP_TABLE_COPY (_bfd_generic),
+    BFD_JUMP_TABLE_CORE (irix_core),
+    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),
+    BFD_JUMP_TABLE_DYNAMIC (_bfd_nodynamic),
 
     NULL,
 
index f4ee631a33f1609e91bd6d77021bbbbd93015add..cc5be3fe34c1c30fd87fd88dda11aa541bd382ce 100644 (file)
@@ -251,8 +251,7 @@ extern boolean _bfd_archive_coff_construct_extended_name_table
 #define _bfd_nosymbols_get_symtab_upper_bound _bfd_n1
 #define _bfd_nosymbols_get_symtab \
   ((long (*) PARAMS ((bfd *, asymbol **))) _bfd_n1)
-#define _bfd_nosymbols_make_empty_symbol \
-  ((asymbol *(*) PARAMS ((bfd *))) bfd_nullvoidptr)
+#define _bfd_nosymbols_make_empty_symbol _bfd_generic_make_empty_symbol
 #define _bfd_nosymbols_print_symbol \
   ((void (*) PARAMS ((bfd *, PTR, asymbol *, bfd_print_symbol_type))) bfd_void)
 #define _bfd_nosymbols_get_symbol_info \
index 911ff0830e8d0e30c5cc16dc5aec2090b4db5eb4..b9ad62354f3b850ddf40c6b888c1693160ab76a4 100644 (file)
@@ -256,8 +256,7 @@ extern boolean _bfd_archive_coff_construct_extended_name_table
 #define _bfd_nosymbols_get_symtab_upper_bound _bfd_n1
 #define _bfd_nosymbols_get_symtab \
   ((long (*) PARAMS ((bfd *, asymbol **))) _bfd_n1)
-#define _bfd_nosymbols_make_empty_symbol \
-  ((asymbol *(*) PARAMS ((bfd *))) bfd_nullvoidptr)
+#define _bfd_nosymbols_make_empty_symbol _bfd_generic_make_empty_symbol
 #define _bfd_nosymbols_print_symbol \
   ((void (*) PARAMS ((bfd *, PTR, asymbol *, bfd_print_symbol_type))) bfd_void)
 #define _bfd_nosymbols_get_symbol_info \
index e9034de3db79c2033957b8f1707dfe3d221998a1..019160c3386d8d44c580b61b74ea1c10b54b343d 100644 (file)
--- a/bfd/mmo.c
+++ b/bfd/mmo.c
@@ -1,5 +1,5 @@
 /* BFD back-end for mmo objects (MMIX-specific object-format).
-   Copyright 2001
+   Copyright 2001, 2002
    Free Software Foundation, Inc.
    Written by Hans-Peter Nilsson (hp@bitrange.com).
    Infrastructure and other bits originally copied from srec.c and
@@ -381,7 +381,6 @@ static boolean mmo_get_section_contents
   PARAMS ((bfd *, asection *, PTR, file_ptr, bfd_size_type));
 static long mmo_get_symtab_upper_bound PARAMS ((bfd *));
 static long mmo_get_symtab PARAMS ((bfd *, asymbol **));
-static asymbol *mmo_make_empty_symbol PARAMS ((bfd *));
 static void mmo_get_symbol_info PARAMS ((bfd *, asymbol *, symbol_info *));
 static void mmo_print_symbol PARAMS ((bfd *, PTR, asymbol *,
                                      bfd_print_symbol_type));
@@ -2188,19 +2187,6 @@ mmo_get_symtab (abfd, alocation)
   return symcount;
 }
 
-/* Make an empty symbol.  */
-
-static asymbol *
-mmo_make_empty_symbol (abfd)
-     bfd *abfd;
-{
-  asymbol *new = (asymbol *) bfd_zalloc (abfd, sizeof (asymbol));
-
-  if (new)
-    new->the_bfd = abfd;
-  return new;
-}
-
 /* Get information about a symbol.  */
 
 static void
@@ -3171,6 +3157,7 @@ mmo_canonicalize_reloc (abfd, section, relptr, symbols)
 /* FIXME: We can do better on this one, if we have a dwarf2 .debug_line
    section or if MMO line numbers are implemented.  */
 #define mmo_find_nearest_line _bfd_nosymbols_find_nearest_line
+#define mmo_make_empty_symbol _bfd_generic_make_empty_symbol
 #define mmo_bfd_make_debug_symbol _bfd_nosymbols_bfd_make_debug_symbol
 #define mmo_read_minisymbols _bfd_generic_read_minisymbols
 #define mmo_minisymbol_to_symbol _bfd_generic_minisymbol_to_symbol
index a514a2b2dad55bc2eca83e7276c39daabb610841..edf54706e599cbcbc6403cdfe74ad93f500887fe 100644 (file)
@@ -30,21 +30,13 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
 
 /* forward declarations */
 
-static asection *
-make_bfd_asection PARAMS ((bfd *, const char *, flagword, bfd_size_type,
-                          bfd_vma, file_ptr));
-static asymbol *
-osf_core_make_empty_symbol PARAMS ((bfd *));
-static const bfd_target *
-osf_core_core_file_p PARAMS ((bfd *));
-static char *
-osf_core_core_file_failing_command PARAMS ((bfd *));
-static int
-osf_core_core_file_failing_signal PARAMS ((bfd *));
-static boolean
-osf_core_core_file_matches_executable_p PARAMS ((bfd *, bfd *));
-static void
-swap_abort PARAMS ((void));
+static asection *make_bfd_asection
+  PARAMS ((bfd *, const char *, flagword, bfd_size_type, bfd_vma, file_ptr));
+static const bfd_target *osf_core_core_file_p PARAMS ((bfd *));
+static char *osf_core_core_file_failing_command PARAMS ((bfd *));
+static int osf_core_core_file_failing_signal PARAMS ((bfd *));
+static boolean osf_core_core_file_matches_executable_p PARAMS ((bfd *, bfd *));
+static void swap_abort PARAMS ((void));
 
 /* These are stored in the bfd's tdata */
 
@@ -82,18 +74,6 @@ make_bfd_asection (abfd, name, flags, _raw_size, vma, filepos)
   return asect;
 }
 
-static asymbol *
-osf_core_make_empty_symbol (abfd)
-     bfd *abfd;
-{
-  asymbol *new;
-
-  new = (asymbol *) bfd_zalloc (abfd, (bfd_size_type) sizeof (asymbol));
-  if (new)
-    new->the_bfd = abfd;
-  return new;
-}
-
 static const bfd_target *
 osf_core_core_file_p (abfd)
      bfd *abfd;
@@ -196,17 +176,6 @@ osf_core_core_file_matches_executable_p (core_bfd, exec_bfd)
   return true;         /* FIXME, We have no way of telling at this point */
 }
 \f
-#define osf_core_get_symtab_upper_bound _bfd_nosymbols_get_symtab_upper_bound
-#define osf_core_get_symtab _bfd_nosymbols_get_symtab
-#define osf_core_print_symbol _bfd_nosymbols_print_symbol
-#define osf_core_get_symbol_info _bfd_nosymbols_get_symbol_info
-#define osf_core_bfd_is_local_label_name _bfd_nosymbols_bfd_is_local_label_name
-#define osf_core_get_lineno _bfd_nosymbols_get_lineno
-#define osf_core_find_nearest_line _bfd_nosymbols_find_nearest_line
-#define osf_core_bfd_make_debug_symbol _bfd_nosymbols_bfd_make_debug_symbol
-#define osf_core_read_minisymbols _bfd_nosymbols_read_minisymbols
-#define osf_core_minisymbol_to_symbol _bfd_nosymbols_minisymbol_to_symbol
-
 /* If somebody calls any byte-swapping routines, shoot them.  */
 static void
 swap_abort()
@@ -253,15 +222,15 @@ const bfd_target osf_core_vec =
      bfd_false, bfd_false
     },
 
-       BFD_JUMP_TABLE_GENERIC (_bfd_generic),
-       BFD_JUMP_TABLE_COPY (_bfd_generic),
-       BFD_JUMP_TABLE_CORE (osf_core),
-       BFD_JUMP_TABLE_ARCHIVE (_bfd_noarchive),
-       BFD_JUMP_TABLE_SYMBOLS (osf_core),
-       BFD_JUMP_TABLE_RELOCS (_bfd_norelocs),
-       BFD_JUMP_TABLE_WRITE (_bfd_generic),
-       BFD_JUMP_TABLE_LINK (_bfd_nolink),
-       BFD_JUMP_TABLE_DYNAMIC (_bfd_nodynamic),
+    BFD_JUMP_TABLE_GENERIC (_bfd_generic),
+    BFD_JUMP_TABLE_COPY (_bfd_generic),
+    BFD_JUMP_TABLE_CORE (osf_core),
+    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),
+    BFD_JUMP_TABLE_DYNAMIC (_bfd_nodynamic),
 
     NULL,
 
index cd196b8920228d616ffd52e33c1469992da42e20..9ac3f31bfb04882d02e0b8d7c1bf840d47d6b3a5 100644 (file)
@@ -1,5 +1,5 @@
 /* BFD back-end for PPCbug boot records.
-   Copyright 1996, 1997, 1998, 1999, 2000, 2001
+   Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002
    Free Software Foundation, Inc.
    Written by Michael Meissner, Cygnus Support, <meissner@cygnus.com>
 
@@ -96,7 +96,6 @@ static boolean ppcboot_get_section_contents
 static long ppcboot_get_symtab_upper_bound PARAMS ((bfd *));
 static char *mangle_name PARAMS ((bfd *, char *));
 static long ppcboot_get_symtab PARAMS ((bfd *, asymbol **));
-static asymbol *ppcboot_make_empty_symbol PARAMS ((bfd *));
 static void ppcboot_get_symbol_info PARAMS ((bfd *, asymbol *, symbol_info *));
 static boolean ppcboot_set_section_contents
   PARAMS ((bfd *, asection *, PTR, file_ptr, bfd_size_type));
@@ -332,17 +331,7 @@ ppcboot_get_symtab (abfd, alocation)
   return PPCBOOT_SYMS;
 }
 
-\f
-/* Make an empty symbol.  */
-
-static asymbol *
-ppcboot_make_empty_symbol (abfd)
-     bfd *abfd;
-{
-  return (asymbol *) bfd_alloc (abfd, (bfd_size_type) sizeof (asymbol));
-}
-
-\f
+#define ppcboot_make_empty_symbol _bfd_generic_make_empty_symbol
 #define ppcboot_print_symbol _bfd_nosymbols_print_symbol
 
 /* Get information about a symbol.  */
index b78ee59b2d991e660fce11631754108a50a17da7..9f5b7934ac26fd8d763cdd1e5ae9eef6d39c0a44 100644 (file)
@@ -43,7 +43,6 @@ struct sco5_core_struct
 static asection *
 make_bfd_asection PARAMS ((bfd *, const char *, flagword, bfd_size_type,
                            bfd_vma, file_ptr));
-static asymbol *sco5_core_make_empty_symbol PARAMS ((bfd *));
 static struct user *read_uarea PARAMS ((bfd *, int));
 const bfd_target *sco5_core_file_p PARAMS ((bfd *abfd));
 char *sco5_core_file_failing_command PARAMS ((bfd *abfd));
@@ -75,18 +74,6 @@ make_bfd_asection (abfd, name, flags, _raw_size, vma, filepos)
   return asect;
 }
 
-static asymbol *
-sco5_core_make_empty_symbol (abfd)
-     bfd *abfd;
-{
-  asymbol *new;
-
-  new = (asymbol *) bfd_zalloc (abfd, (bfd_size_type) sizeof (asymbol));
-  if (new)
-    new->the_bfd = abfd;
-  return new;
-}
-
 static struct user *
 read_uarea(abfd, filepos)
      bfd *abfd;
@@ -371,17 +358,6 @@ sco5_core_file_matches_executable_p  (core_bfd, exec_bfd)
   return true;          /* FIXME, We have no way of telling at this point */
 }
 
-#define sco5_core_get_symtab_upper_bound _bfd_nosymbols_get_symtab_upper_bound
-#define sco5_core_get_symtab _bfd_nosymbols_get_symtab
-#define sco5_core_print_symbol _bfd_nosymbols_print_symbol
-#define sco5_core_get_symbol_info _bfd_nosymbols_get_symbol_info
-#define sco5_core_bfd_is_local_label_name _bfd_nosymbols_bfd_is_local_label_name
-#define sco5_core_get_lineno _bfd_nosymbols_get_lineno
-#define sco5_core_find_nearest_line _bfd_nosymbols_find_nearest_line
-#define sco5_core_bfd_make_debug_symbol _bfd_nosymbols_bfd_make_debug_symbol
-#define sco5_core_read_minisymbols _bfd_nosymbols_read_minisymbols
-#define sco5_core_minisymbol_to_symbol _bfd_nosymbols_minisymbol_to_symbol
-
 /* If somebody calls any byte-swapping routines, shoot them.  */
 static void
 swap_abort ()
@@ -428,15 +404,15 @@ const bfd_target sco5_core_vec =
      bfd_false, bfd_false
     },
 
-       BFD_JUMP_TABLE_GENERIC (_bfd_generic),
-       BFD_JUMP_TABLE_COPY (_bfd_generic),
-       BFD_JUMP_TABLE_CORE (sco5),
-       BFD_JUMP_TABLE_ARCHIVE (_bfd_noarchive),
-       BFD_JUMP_TABLE_SYMBOLS (sco5_core),
-       BFD_JUMP_TABLE_RELOCS (_bfd_norelocs),
-       BFD_JUMP_TABLE_WRITE (_bfd_generic),
-       BFD_JUMP_TABLE_LINK (_bfd_nolink),
-       BFD_JUMP_TABLE_DYNAMIC (_bfd_nodynamic),
+    BFD_JUMP_TABLE_GENERIC (_bfd_generic),
+    BFD_JUMP_TABLE_COPY (_bfd_generic),
+    BFD_JUMP_TABLE_CORE (sco5),
+    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),
+    BFD_JUMP_TABLE_DYNAMIC (_bfd_nodynamic),
 
     NULL,
 
index 5cb83caedd40c82a7bacea04b414450c4137d112..5dfad8890d13251a2a45ef4f53670f0bd82525d8 100644 (file)
@@ -1,6 +1,6 @@
 /* BFD back-end for s-record objects.
    Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
-   2000, 2001
+   2000, 2001, 2002
    Free Software Foundation, Inc.
    Written by Steve Chamberlain of Cygnus Support <sac@cygnus.com>.
 
@@ -138,7 +138,6 @@ static boolean internal_srec_write_object_contents PARAMS ((bfd *, int));
 static boolean srec_write_object_contents PARAMS ((bfd *));
 static boolean symbolsrec_write_object_contents PARAMS ((bfd *));
 static int srec_sizeof_headers PARAMS ((bfd *, boolean));
-static asymbol *srec_make_empty_symbol PARAMS ((bfd *));
 static long srec_get_symtab_upper_bound PARAMS ((bfd *));
 static long srec_get_symtab PARAMS ((bfd *, asymbol **));
 
@@ -1150,18 +1149,6 @@ srec_sizeof_headers (abfd, exec)
   return 0;
 }
 
-static asymbol *
-srec_make_empty_symbol (abfd)
-     bfd *abfd;
-{
-  asymbol *new;
-
-  new = (asymbol *) bfd_zalloc (abfd, (bfd_size_type) sizeof (asymbol));
-  if (new)
-    new->the_bfd = abfd;
-  return new;
-}
-
 /* Return the amount of memory needed to read the symbol table.  */
 
 static long
@@ -1251,6 +1238,7 @@ srec_print_symbol (abfd, afile, symbol, how)
 #define srec_bfd_is_local_label_name bfd_generic_is_local_label_name
 #define srec_get_lineno _bfd_nosymbols_get_lineno
 #define srec_find_nearest_line _bfd_nosymbols_find_nearest_line
+#define srec_make_empty_symbol _bfd_generic_make_empty_symbol
 #define srec_bfd_make_debug_symbol _bfd_nosymbols_bfd_make_debug_symbol
 #define srec_read_minisymbols _bfd_generic_read_minisymbols
 #define srec_minisymbol_to_symbol _bfd_generic_minisymbol_to_symbol
index 03c41a5286220cb0aa7f0cbb2af8e3d7a9abc3c4..9ec9dd8e769d96659c8c189985aff7b0a1d16f0a 100644 (file)
@@ -494,6 +494,31 @@ DESCRIPTION
 .     BFD_SEND (abfd, _bfd_make_empty_symbol, (abfd))
 */
 
+/*
+FUNCTION
+       _bfd_generic_make_empty_symbol
+
+SYNOPSIS
+       asymbol *_bfd_generic_make_empty_symbol (bfd *);
+
+DESCRIPTION
+       Create a new <<asymbol>> structure for the BFD @var{abfd}
+       and return a pointer to it.  Used by core file routines,
+       binary back-end and anywhere else where no private info
+       is needed.
+*/
+
+asymbol *
+_bfd_generic_make_empty_symbol (abfd)
+     bfd *abfd;
+{
+  bfd_size_type amt = sizeof (asymbol);
+  asymbol *new = (asymbol *) bfd_zalloc (abfd, amt);
+  if (new)
+    new->the_bfd = abfd;
+  return new;
+}
+
 /*
 FUNCTION
        bfd_make_debug_symbol
index 276a1019b768ded4ec3a79229d9469e0377d746b..37eb94ceb583729dfb9c316c51edc57dc23ba1a3 100644 (file)
@@ -1,5 +1,6 @@
 /* BFD back-end for VERSAdos-E objects.
-   Copyright 1995, 1996, 1998, 1999, 2000, 2001 Free Software Foundation, Inc.
+   Copyright 1995, 1996, 1998, 1999, 2000, 2001, 2002
+   Free Software Foundation, Inc.
    Written by Steve Chamberlain of Cygnus Support <sac@cygnus.com>.
 
    Versados is a Motorola trademark.
@@ -55,7 +56,6 @@ static boolean versados_get_section_contents
 static boolean versados_set_section_contents
   PARAMS ((bfd *, sec_ptr, void *, file_ptr, bfd_size_type));
 static int versados_sizeof_headers PARAMS ((bfd *, boolean));
-static asymbol *versados_make_empty_symbol PARAMS ((bfd *));
 static long int versados_get_symtab_upper_bound PARAMS ((bfd *));
 static long int versados_get_symtab PARAMS ((bfd *, asymbol **));
 static void versados_get_symbol_info
@@ -723,18 +723,6 @@ versados_sizeof_headers (abfd, exec)
   return 0;
 }
 
-static asymbol *
-versados_make_empty_symbol (abfd)
-     bfd *abfd;
-{
-  asymbol *new;
-
-  new = (asymbol *) bfd_zalloc (abfd, (bfd_size_type) sizeof (asymbol));
-  if (new)
-    new->the_bfd = abfd;
-  return new;
-}
-
 /* Return the amount of memory needed to read the symbol table.  */
 
 static long
@@ -865,6 +853,7 @@ versados_canonicalize_reloc (abfd, section, relptr, symbols)
 #define versados_bfd_is_local_label_name bfd_generic_is_local_label_name
 #define versados_get_lineno _bfd_nosymbols_get_lineno
 #define versados_find_nearest_line _bfd_nosymbols_find_nearest_line
+#define versados_make_empty_symbol _bfd_generic_make_empty_symbol
 #define versados_bfd_make_debug_symbol _bfd_nosymbols_bfd_make_debug_symbol
 #define versados_read_minisymbols _bfd_generic_read_minisymbols
 #define versados_minisymbol_to_symbol _bfd_generic_minisymbol_to_symbol
index 538c148cb2030eaa5bd105c7050bca601dc57746..d9dcd7857896f3773df1c3a5f11f96c1ce28020c 100644 (file)
@@ -1,6 +1,7 @@
 /* vms-gsd.c -- BFD back-end for VAX (openVMS/VAX) and
    EVAX (openVMS/Alpha) files.
-   Copyright 1996, 1997, 1998, 1999, 2000, 2001 Free Software Foundation, Inc.
+   Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002
+   Free Software Foundation, Inc.
 
    go and read the openVMS linker manual (esp. appendix B)
    if you don't know what's going on here :-)
@@ -635,7 +636,7 @@ _bfd_vms_slurp_gsd (abfd, objtype)
          {
            /* symbol specification (definition or reference)  */
 
-           symbol = _bfd_vms_make_empty_symbol (abfd);
+           symbol = bfd_make_empty_symbol (abfd);
            if (symbol == 0)
              return -1;
 
index 0c8236fb1ac43e8d186c0f5f243db92b9b9b3cdd..b871a5d3ae0142f80c65e8a839e5a21167a4eba8 100644 (file)
@@ -1,6 +1,6 @@
 /* vms-misc.c -- Miscellaneous functions for VAX (openVMS/VAX) and
    EVAX (openVMS/Alpha) files.
-   Copyright 1996, 1997, 1998, 1999, 2000, 2001
+   Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002
    Free Software Foundation, Inc.
 
    Written by Klaus K"ampf (kkaempf@rmi.de)
@@ -1070,7 +1070,7 @@ new_symbol (abfd, name)
   _bfd_vms_debug (7,  "new_symbol %s\n", name);
 #endif
 
-  symbol = _bfd_vms_make_empty_symbol (abfd);
+  symbol = bfd_make_empty_symbol (abfd);
   if (symbol == 0)
     return symbol;
   symbol->name = name;
index 55bcf6193cbe2facc7d04b389705b8ed3ed75e73..388b7270a3ee30dd2d2dc7cdac8b3f2fe7d1cd8b 100644 (file)
--- a/bfd/vms.c
+++ b/bfd/vms.c
@@ -1,6 +1,6 @@
 /* vms.c -- BFD back-end for VAX (openVMS/VAX) and
    EVAX (openVMS/Alpha) files.
-   Copyright 1996, 1997, 1998, 1999, 2000, 2001
+   Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002
    Free Software Foundation, Inc.
 
    Written by Klaus K"ampf (kkaempf@rmi.de)
@@ -129,7 +129,7 @@ static long vms_canonicalize_dynamic_reloc
 static boolean vms_bfd_merge_private_bfd_data PARAMS ((bfd *ibfd, bfd *obfd));
 static boolean vms_bfd_set_private_flags PARAMS ((bfd *abfd, flagword flags));
 
-#define vms_make_empty_symbol _bfd_vms_make_empty_symbol
+#define vms_make_empty_symbol _bfd_generic_make_empty_symbol
 \f
 /*===========================================================================*/
 
@@ -1142,34 +1142,6 @@ vms_get_symtab (abfd, symbols)
   return PRIV (gsd_sym_count);
 }
 
-/* Create a new asymbol structure for the BFD abfd and return a pointer
-   to it.
-   This routine is necessary because each back end has private information
-   surrounding the asymbol. Building your own asymbol and pointing to it
-   will not create the private information, and will cause problems later on.  */
-
-asymbol *
-_bfd_vms_make_empty_symbol (abfd)
-     bfd *abfd;
-{
-  asymbol *symbol;
-
-  symbol = (asymbol *) bfd_zalloc(abfd, (bfd_size_type) sizeof (asymbol));
-
-#if VMS_DEBUG
-  vms_debug (1, "_bfd_vms_make_empty_symbol(%p)\n", abfd);
-#endif
-
-  if (symbol == 0)
-    {
-      bfd_set_error (bfd_error_no_memory);
-      return 0;
-    }
-  symbol->the_bfd = abfd;
-
-  return symbol;
-}
-
 /* Print symbol to file according to how. how is one of
    bfd_print_symbol_name       just print the name
    bfd_print_symbol_more       print more (???)