]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
goodbye aout_section_data
authorAlan Modra <amodra@gmail.com>
Mon, 16 Dec 2024 07:38:54 +0000 (18:08 +1030)
committerAlan Modra <amodra@gmail.com>
Mon, 16 Dec 2024 09:07:40 +0000 (19:37 +1030)
aout_section_data->relocs isn't set by anything, so delete it.

bfd/aoutx.h
bfd/libaout.h
bfd/pdp11.c

index 5f62ac67cfd0c2cd922e32c8777298b905caf8cc..2639655c7f9fe151a71755b60bce485e681fc7a8 100644 (file)
@@ -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.  */
index 05b5e13bcd837841bf62ec400b69ca5e92605c5a..abdabfa890267fe4344d6ceb5dc4f98dca5a4df7 100644 (file)
@@ -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)
index f65760f9ee69da4fd608f3f439c400076be2725a..8fa3a54576124d916667e2e0a15a1952cf342d81 100644 (file)
@@ -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.  */