[binutils-gdb] bfd/aout: drop add_one_symbol() hook

Jan Beulich jbeulich@sourceware.org
Mon Apr 14 12:26:37 GMT 2025


https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=7c96ca457993267db20d31d239e3d84c2c48f1ec

commit 7c96ca457993267db20d31d239e3d84c2c48f1ec
Author: Jan Beulich <jbeulich@suse.com>
Date:   Mon Apr 14 14:23:29 2025 +0200

    bfd/aout: drop add_one_symbol() hook
    
    The need for this has disappeared with c65c21e1ffd1 ("various i386-aout
    and i386-coff target removal"), with a few other users having got
    removed just a few days earlier; avoid the unnecessary indirection.

Diff:
---
 bfd/aout-target.h | 4 ----
 bfd/aoutx.h       | 9 +--------
 bfd/i386aout.c    | 1 -
 bfd/libaout.h     | 7 -------
 bfd/pdp11.c       | 9 +--------
 5 files changed, 2 insertions(+), 28 deletions(-)

diff --git a/bfd/aout-target.h b/bfd/aout-target.h
index f513e1bb558..1b711047f28 100644
--- a/bfd/aout-target.h
+++ b/bfd/aout-target.h
@@ -286,9 +286,6 @@ MY (set_sizes) (bfd *abfd)
 #ifndef MY_add_dynamic_symbols
 #define MY_add_dynamic_symbols 0
 #endif
-#ifndef MY_add_one_symbol
-#define MY_add_one_symbol 0
-#endif
 #ifndef MY_link_dynamic_object
 #define MY_link_dynamic_object 0
 #endif
@@ -312,7 +309,6 @@ static const struct aout_backend_data MY (backend_data) =
   MY_set_sizes,
   MY_exec_header_not_counted,
   MY_add_dynamic_symbols,
-  MY_add_one_symbol,
   MY_link_dynamic_object,
   MY_write_dynamic_symbol,
   MY_check_dynamic_reloc,
diff --git a/bfd/aoutx.h b/bfd/aoutx.h
index 63c654faae4..81e08041039 100644
--- a/bfd/aoutx.h
+++ b/bfd/aoutx.h
@@ -2973,9 +2973,6 @@ NAME (aout, link_hash_table_create) (bfd *abfd)
 static bool
 aout_link_add_symbols (bfd *abfd, struct bfd_link_info *info)
 {
-  bool (*add_one_symbol)
-    (struct bfd_link_info *, bfd *, const char *, flagword, asection *,
-     bfd_vma, const char *, bool, bool, struct bfd_link_hash_entry **);
   struct external_nlist *syms;
   bfd_size_type sym_count;
   char *strings;
@@ -3013,10 +3010,6 @@ aout_link_add_symbols (bfd *abfd, struct bfd_link_info *info)
     return false;
   obj_aout_sym_hashes (abfd) = sym_hash;
 
-  add_one_symbol = aout_backend_info (abfd)->add_one_symbol;
-  if (add_one_symbol == NULL)
-    add_one_symbol = _bfd_generic_link_add_one_symbol;
-
   p = syms;
   pend = p + sym_count;
   for (; p < pend; p++, sym_hash++)
@@ -3167,7 +3160,7 @@ aout_link_add_symbols (bfd *abfd, struct bfd_link_info *info)
 	  break;
 	}
 
-      if (! ((*add_one_symbol)
+      if (! (_bfd_generic_link_add_one_symbol
 	     (info, abfd, name, flags, section, value, string, copy, false,
 	      (struct bfd_link_hash_entry **) sym_hash)))
 	return false;
diff --git a/bfd/i386aout.c b/bfd/i386aout.c
index fb095974c1e..082ebfb59f5 100644
--- a/bfd/i386aout.c
+++ b/bfd/i386aout.c
@@ -79,7 +79,6 @@ static const struct aout_backend_data MY (backend_data) =
   MY (set_sizes),
   1,				/* Exec header not counted.  */
   0,				/* Add_dynamic_symbols.  */
-  0,				/* Add_one_symbol.  */
   0,				/* Link_dynamic_object.  */
   0,				/* Write_dynamic_symbol.  */
   0,				/* Check_dynamic_reloc.  */
diff --git a/bfd/libaout.h b/bfd/libaout.h
index ca4faec8ed6..7628d6a5114 100644
--- a/bfd/libaout.h
+++ b/bfd/libaout.h
@@ -177,13 +177,6 @@ struct aout_backend_data
     (bfd *, struct bfd_link_info *, struct external_nlist **,
      bfd_size_type *, char **);
 
-  /* Callback from the add symbols phase of the linker code to handle
-     adding a single symbol to the global linker hash table.  */
-  bool (*add_one_symbol)
-    (struct bfd_link_info *, bfd *, const char *, flagword,
-     asection *, bfd_vma, const char *, bool, bool,
-     struct bfd_link_hash_entry **);
-
   /* Called to handle linking a dynamic object.  */
   bool (*link_dynamic_object)
     (struct bfd_link_info *, bfd *);
diff --git a/bfd/pdp11.c b/bfd/pdp11.c
index bdd9fc27fbb..2d12033f086 100644
--- a/bfd/pdp11.c
+++ b/bfd/pdp11.c
@@ -2839,9 +2839,6 @@ aout_link_check_archive_element (bfd *abfd,
 static bool
 aout_link_add_symbols (bfd *abfd, struct bfd_link_info *info)
 {
-  bool (*add_one_symbol)
-    (struct bfd_link_info *, bfd *, const char *, flagword, asection *,
-     bfd_vma, const char *, bool, bool, struct bfd_link_hash_entry **);
   struct external_nlist *syms;
   bfd_size_type sym_count;
   char *strings;
@@ -2875,10 +2872,6 @@ aout_link_add_symbols (bfd *abfd, struct bfd_link_info *info)
     return false;
   obj_aout_sym_hashes (abfd) = sym_hash;
 
-  add_one_symbol = aout_backend_info (abfd)->add_one_symbol;
-  if (add_one_symbol == NULL)
-    add_one_symbol = _bfd_generic_link_add_one_symbol;
-
   p = syms;
   pend = p + sym_count;
   for (; p < pend; p++, sym_hash++)
@@ -2951,7 +2944,7 @@ aout_link_add_symbols (bfd *abfd, struct bfd_link_info *info)
 	  break;
 	}
 
-      if (! ((*add_one_symbol)
+      if (! (_bfd_generic_link_add_one_symbol
 	     (info, abfd, name, flags, section, value, string, copy, false,
 	      (struct bfd_link_hash_entry **) sym_hash)))
 	return false;


More information about the Binutils-cvs mailing list