public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
From: Alan Modra <amodra@gmail.com>
To: binutils@sourceware.org
Subject: Delete struct artdata archive_head
Date: Fri, 21 Apr 2023 12:08:55 +0930	[thread overview]
Message-ID: <ZEH3P5K8BQ4euUsQ@squeak.grove.modra.org> (raw)

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.

diff --git a/bfd/archive.c b/bfd/archive.c
index 4cc2f7c9487..01bfcfc80a1 100644
--- a/bfd/archive.c
+++ b/bfd/archive.c
@@ -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)))
diff --git a/bfd/coff-rs6000.c b/bfd/coff-rs6000.c
index 6c4e32c9f0d..5ea06fa2e09 100644
--- a/bfd/coff-rs6000.c
+++ b/bfd/coff-rs6000.c
@@ -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')
     {
diff --git a/bfd/coff64-rs6000.c b/bfd/coff64-rs6000.c
index f8a0bde8c30..a4f631ce0e0 100644
--- a/bfd/coff64-rs6000.c
+++ b/bfd/coff64-rs6000.c
@@ -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);
diff --git a/bfd/libbfd-in.h b/bfd/libbfd-in.h
index 561cef1a12e..68b5343fd2e 100644
--- a/bfd/libbfd-in.h
+++ b/bfd/libbfd-in.h
@@ -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.  */
diff --git a/bfd/libbfd.h b/bfd/libbfd.h
index ae17717efa3..bb7f2f1efcf 100644
--- a/bfd/libbfd.h
+++ b/bfd/libbfd.h
@@ -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.  */

-- 
Alan Modra
Australia Development Lab, IBM

                 reply	other threads:[~2023-04-21  2:39 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ZEH3P5K8BQ4euUsQ@squeak.grove.modra.org \
    --to=amodra@gmail.com \
    --cc=binutils@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).