From: Nick Clifton Date: Tue, 20 Sep 2022 10:46:32 +0000 (+0100) Subject: Stop strip from complaining about empty note sections when stripping a binary for... X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=1588d98babe46881783a40d70d8b8baa91c156b8;p=binutils-gdb.git 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 --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 + + * objcopy.c (copy_object): Do not issue a warning message when + encountering empty .gnu.build.attribute sections. + 2022-09-14 Rupesh Potharla * 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;