[v2,2/3] bfd/aout: drop add_one_symbol() hook

Message ID 1686ccad-8c83-4bf3-bd0d-22946d53e376@suse.com
State New
Headers
Series PE/COFF: function size (and fallout) |

Checks

Context Check Description
linaro-tcwg-bot/tcwg_binutils_build--master-aarch64 success Build passed
linaro-tcwg-bot/tcwg_binutils_build--master-arm success Build passed
linaro-tcwg-bot/tcwg_binutils_check--master-arm success Test passed
linaro-tcwg-bot/tcwg_binutils_check--master-aarch64 success Test passed

Commit Message

Jan Beulich April 7, 2025, 1:53 p.m. UTC
  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.
---
v2: New.
  

Patch

--- 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
   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,
--- a/bfd/aoutx.h
+++ b/bfd/aoutx.h
@@ -2973,9 +2973,6 @@  NAME (aout, link_hash_table_create) (bfd
 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
     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
 	  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;
--- a/bfd/i386aout.c
+++ b/bfd/i386aout.c
@@ -79,7 +79,6 @@  static const struct aout_backend_data MY
   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.  */
--- 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 *);
--- a/bfd/pdp11.c
+++ b/bfd/pdp11.c
@@ -2839,9 +2839,6 @@  aout_link_check_archive_element (bfd *ab
 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
     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
 	  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;