public inbox for binutils-cvs@sourceware.org
 help / color / mirror / Atom feed
From: Nick Clifton <nickc@sourceware.org>
To: bfd-cvs@sourceware.org
Subject: [binutils-gdb] Stop strip from complaining about empty note sections when stripping a binary for a second time.
Date: Tue, 20 Sep 2022 10:47:11 +0000 (GMT)	[thread overview]
Message-ID: <20220920104712.3E74E3858D28@sourceware.org> (raw)

https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=1588d98babe46881783a40d70d8b8baa91c156b8

commit 1588d98babe46881783a40d70d8b8baa91c156b8
Author: Nick Clifton <nickc@redhat.com>
Date:   Tue Sep 20 11:46:32 2022 +0100

    Stop strip from complaining about empty note sections when stripping a binary for a second time.
    
            * objcopy.c (copy_object): Do not issue a warning message when
            encountering empty .gnu.build.attribute sections.

Diff:
---
 binutils/ChangeLog | 5 +++++
 binutils/objcopy.c | 8 +++-----
 2 files changed, 8 insertions(+), 5 deletions(-)

diff --git a/binutils/ChangeLog b/binutils/ChangeLog
index 19f76653dac..c1450155e0d 100644
--- a/binutils/ChangeLog
+++ b/binutils/ChangeLog
@@ -1,3 +1,8 @@
+2022-09-20  Nick Clifton  <nickc@redhat.com>
+
+	* objcopy.c (copy_object): Do not issue a warning message when
+	encountering empty .gnu.build.attribute sections.
+
 2022-09-14  Rupesh Potharla  <Rupesh.Potharla@amd.com>
 
 	* testsuite/binutils-all/readelf.exp (readelf_wi_test): Extend
diff --git a/binutils/objcopy.c b/binutils/objcopy.c
index 75992e8a3f7..43261756a42 100644
--- a/binutils/objcopy.c
+++ b/binutils/objcopy.c
@@ -2968,11 +2968,9 @@ copy_object (bfd *ibfd, bfd *obfd, const bfd_arch_info_type *input_arch)
 	  bfd_size_type size = bfd_section_size (osec);
 
 	  if (size == 0)
-	    {
-	      bfd_nonfatal_message (NULL, ibfd, osec,
-				    _("warning: note section is empty"));
-	      continue;
-	    }
+	    /* This can happen, eg when stripping a binary for a second
+	       time.  See BZ 2121365 for an example.  */
+	    continue;
 
 	  merged_note_section * merged = xmalloc (sizeof * merged);
 	  merged->contents = NULL;

                 reply	other threads:[~2022-09-20 10:47 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=20220920104712.3E74E3858D28@sourceware.org \
    --to=nickc@sourceware.org \
    --cc=bfd-cvs@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).