Stop strip from complaining about empty note sections when stripping a binary for...
authorNick Clifton <nickc@redhat.com>
Tue, 20 Sep 2022 10:46:32 +0000 (11:46 +0100)
committerNick Clifton <nickc@redhat.com>
Tue, 20 Sep 2022 10:46:32 +0000 (11:46 +0100)
* objcopy.c (copy_object): Do not issue a warning message when
encountering empty .gnu.build.attribute sections.

binutils/ChangeLog
binutils/objcopy.c

index 19f76653dacddf318dc1cc873fc32db8c877cb01..c1450155e0d7ac21eb11a25d0876a6da0354cebc 100644 (file)
@@ -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
index 75992e8a3f797609bcd81166f2e8f7c6d6eb623f..43261756a428d82279a2db4770276fd32b00d3fc 100644 (file)
@@ -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;