Delete struct artdata archive_head
authorAlan Modra <amodra@gmail.com>
Thu, 20 Apr 2023 02:44:09 +0000 (12:14 +0930)
committerAlan Modra <amodra@gmail.com>
Fri, 21 Apr 2023 02:21:06 +0000 (11:51 +0930)
This element is unused.  Ideally we'd be moving archive_head and
other archive specific fields from struct bfd to here, but that's a
much larger change than this little bit of cleanup.

* libbfd-in.h (struct artdata): Delete archive_head.
* libbfd.h: Regenerate.
* archive.c,
* coff-rs6000.c,
* coff64-rs6000.c: Delete comments mentioning artdata archive_head.

bfd/archive.c
bfd/coff-rs6000.c
bfd/coff64-rs6000.c
bfd/libbfd-in.h
bfd/libbfd.h

index 4cc2f7c9487a31134fa1a26a5007504194510c23..01bfcfc80a1aa154c2f53ab4c75b22984f573b4b 100644 (file)
@@ -215,18 +215,7 @@ _bfd_generic_mkarchive (bfd *abfd)
   size_t amt = sizeof (struct artdata);
 
   abfd->tdata.aout_ar_data = (struct artdata *) bfd_zalloc (abfd, amt);
-  if (bfd_ardata (abfd) == NULL)
-    return false;
-
-  /* Already cleared by bfd_zalloc above.
-     bfd_ardata (abfd)->cache = NULL;
-     bfd_ardata (abfd)->archive_head = NULL;
-     bfd_ardata (abfd)->symdefs = NULL;
-     bfd_ardata (abfd)->extended_names = NULL;
-     bfd_ardata (abfd)->extended_names_size = 0;
-     bfd_ardata (abfd)->tdata = NULL;  */
-
-  return true;
+  return bfd_ardata (abfd) != NULL;
 }
 
 /*
@@ -905,13 +894,6 @@ bfd_generic_archive_p (bfd *abfd)
     }
 
   bfd_ardata (abfd)->first_file_filepos = SARMAG;
-  /* Cleared by bfd_zalloc above.
-     bfd_ardata (abfd)->cache = NULL;
-     bfd_ardata (abfd)->archive_head = NULL;
-     bfd_ardata (abfd)->symdefs = NULL;
-     bfd_ardata (abfd)->extended_names = NULL;
-     bfd_ardata (abfd)->extended_names_size = 0;
-     bfd_ardata (abfd)->tdata = NULL;  */
 
   if (!BFD_SEND (abfd, _bfd_slurp_armap, (abfd))
       || !BFD_SEND (abfd, _bfd_slurp_extended_name_table, (abfd)))
index 6c4e32c9f0ddae4945441a1229aa476394ea272b..5ea06fa2e0952cef7d0d1e7143041509034a13b6 100644 (file)
@@ -1527,13 +1527,6 @@ _bfd_xcoff_archive_p (bfd *abfd)
   if (bfd_ardata (abfd) == (struct artdata *) NULL)
     goto error_ret_restore;
 
-  /* Cleared by bfd_zalloc above.
-     bfd_ardata (abfd)->cache = NULL;
-     bfd_ardata (abfd)->archive_head = NULL;
-     bfd_ardata (abfd)->symdefs = NULL;
-     bfd_ardata (abfd)->extended_names = NULL;
-     bfd_ardata (abfd)->extended_names_size = 0;  */
-
   /* Now handle the two formats.  */
   if (magic[1] != 'b')
     {
index f8a0bde8c30f1a0ba3b86547a6bc2ecbdc762527..a4f631ce0e0949baee1ea6decc8e533ace136036 100644 (file)
@@ -1939,12 +1939,6 @@ xcoff64_archive_p (bfd *abfd)
   if (bfd_ardata (abfd) == (struct artdata *) NULL)
     goto error_ret_restore;
 
-  /* Already cleared by bfd_zalloc above.
-     bfd_ardata (abfd)->cache = NULL;
-     bfd_ardata (abfd)->archive_head = NULL;
-     bfd_ardata (abfd)->symdefs = NULL;
-     bfd_ardata (abfd)->extended_names = NULL;
-     bfd_ardata (abfd)->extended_names_size = 0;  */
   bfd_ardata (abfd)->first_file_filepos = bfd_scan_vma (hdr.firstmemoff,
                                                        (const char **) NULL,
                                                        10);
index 561cef1a12e64477c34ef7be98f811687ad9e7c4..68b5343fd2e04a3678b93dd4276c423ecf330d8e 100644 (file)
@@ -75,7 +75,6 @@ struct artdata
   file_ptr first_file_filepos;
   /* Speed up searching the armap */
   htab_t cache;
-  bfd *archive_head;           /* Only interesting in output routines.  */
   carsym *symdefs;             /* The symdef entries.  */
   symindex symdef_count;       /* How many there are.  */
   char *extended_names;                /* Clever intel extension.  */
index ae17717efa366ec606110d7eab03441b70dd248d..bb7f2f1efcfb5617e0cfbfa2712719541cdfc15b 100644 (file)
@@ -81,7 +81,6 @@ struct artdata
   file_ptr first_file_filepos;
   /* Speed up searching the armap */
   htab_t cache;
-  bfd *archive_head;           /* Only interesting in output routines.  */
   carsym *symdefs;             /* The symdef entries.  */
   symindex symdef_count;       /* How many there are.  */
   char *extended_names;                /* Clever intel extension.  */