goodbye aout_section_data

Message ID Z2AHh-2Loi-5G9M5@squeak.grove.modra.org
State New
Headers
Series goodbye aout_section_data |

Checks

Context Check Description
linaro-tcwg-bot/tcwg_binutils_build--master-arm fail Patch failed to apply
linaro-tcwg-bot/tcwg_binutils_build--master-aarch64 fail Patch failed to apply

Commit Message

Alan Modra Dec. 16, 2024, 10:57 a.m. UTC
  aout_section_data->relocs isn't set by anything, so delete it.
  

Patch

diff --git a/bfd/aoutx.h b/bfd/aoutx.h
index 5f62ac67cfd..2639655c7f9 100644
--- a/bfd/aoutx.h
+++ b/bfd/aoutx.h
@@ -4723,19 +4723,12 @@  aout_link_input_section (struct aout_final_link_info *flaginfo,
 				  (file_ptr) 0, input_size))
     return false;
 
-  /* Read in the relocs if we haven't already done it.  */
-  if (aout_section_data (input_section) != NULL
-      && aout_section_data (input_section)->relocs != NULL)
-    relocs = aout_section_data (input_section)->relocs;
-  else
+  relocs = flaginfo->relocs;
+  if (rel_size > 0)
     {
-      relocs = flaginfo->relocs;
-      if (rel_size > 0)
-	{
-	  if (bfd_seek (input_bfd, input_section->rel_filepos, SEEK_SET) != 0
-	      || bfd_read (relocs, rel_size, input_bfd) != rel_size)
-	    return false;
-	}
+      if (bfd_seek (input_bfd, input_section->rel_filepos, SEEK_SET) != 0
+	  || bfd_read (relocs, rel_size, input_bfd) != rel_size)
+	return false;
     }
 
   /* Relocate the section contents.  */
diff --git a/bfd/libaout.h b/bfd/libaout.h
index 05b5e13bcd8..abdabfa8902 100644
--- a/bfd/libaout.h
+++ b/bfd/libaout.h
@@ -449,21 +449,6 @@  struct  aout_data_struct
    macro is only ever applied to an asymbol.  */
 #define aout_symbol(asymbol) ((aout_symbol_type *)(&(asymbol)->the_bfd))
 
-/* Information we keep for each a.out section.  This is currently only
-   used by the a.out backend linker.  */
-
-struct aout_section_data_struct
-{
-  /* The unswapped relocation entries for this section.  */
-  void * relocs;
-};
-
-#define aout_section_data(s) \
-  ((struct aout_section_data_struct *) (s)->used_by_bfd)
-
-#define set_aout_section_data(s,v) \
-  ((s)->used_by_bfd = (void *)&(v)->relocs)
-
 /* Prototype declarations for functions defined in aoutx.h.  */
 
 extern bool NAME (aout, squirt_out_relocs)
diff --git a/bfd/pdp11.c b/bfd/pdp11.c
index f65760f9ee6..8fa3a545761 100644
--- a/bfd/pdp11.c
+++ b/bfd/pdp11.c
@@ -3655,19 +3655,12 @@  aout_link_input_section (struct aout_final_link_info *flaginfo,
 				  (file_ptr) 0, input_size))
     return false;
 
-  /* Read in the relocs if we haven't already done it.  */
-  if (aout_section_data (input_section) != NULL
-      && aout_section_data (input_section)->relocs != NULL)
-    relocs = aout_section_data (input_section)->relocs;
-  else
+  relocs = flaginfo->relocs;
+  if (rel_size > 0)
     {
-      relocs = flaginfo->relocs;
-      if (rel_size > 0)
-	{
-	  if (bfd_seek (input_bfd, input_section->rel_filepos, SEEK_SET) != 0
-	      || bfd_read (relocs, rel_size, input_bfd) != rel_size)
-	    return false;
-	}
+      if (bfd_seek (input_bfd, input_section->rel_filepos, SEEK_SET) != 0
+	  || bfd_read (relocs, rel_size, input_bfd) != rel_size)
+	return false;
     }
 
   /* Relocate the section contents.  */