Fix strip when merging multiple same-named sections.

Resolves: #1885607
This commit is contained in:
Nick Clifton 2021-01-14 16:57:05 +00:00
parent e4e1fcf172
commit a3451687e1
2 changed files with 29 additions and 1 deletions

View File

@ -0,0 +1,19 @@
--- binutils.orig/binutils/objcopy.c 2021-01-14 09:09:30.796925559 +0000
+++ binutils-2.35/binutils/objcopy.c 2021-01-14 15:45:38.105153686 +0000
@@ -3313,14 +3313,12 @@ copy_object (bfd *ibfd, bfd *obfd, const
/* It is likely that output sections are in the same order
as the input sections, but do not assume that this is
the case. */
- if (strcmp (bfd_section_name (merged->sec),
- bfd_section_name (osec)) != 0)
+ if (merged->sec->output_section != osec)
{
for (merged = merged_note_sections;
merged != NULL;
merged = merged->next)
- if (strcmp (bfd_section_name (merged->sec),
- bfd_section_name (osec)) == 0)
+ if (merged->sec->output_section == osec)
break;
if (merged == NULL)

View File

@ -2,7 +2,7 @@
Summary: A GNU collection of binary utilities
Name: %{?cross}binutils%{?_with_debug:-debug}
Version: 2.35
Release: 16%{?dist}
Release: 17%{?dist}
License: GPLv3+
URL: https://sourceware.org/binutils
@ -250,6 +250,11 @@ Patch28: binutils-dwarf-type-sign.patch
# Lifetime: Fixed in 2.36 and on 2.35-branch
Patch29: binutils-dwarf5-2_35-branch.patch
# Purpose: Fix the strip program to cope when merging multiple same-named
# sections.
# Lifetime: Fixed in 2.36
Patch30: binutils-strip-merge.patch
#----------------------------------------------------------------------------
Provides: bundled(libiberty)
@ -823,6 +828,10 @@ exit 0
#----------------------------------------------------------------------------
%changelog
* Thu Jan 14 2021 Nick Clifton <nickc@redhat.com> - 2.35-17
- Fix strip when merging multiple same-named sections. (#1885607)
* Fri Jan 08 2021 Nick Clifton <nickc@redhat.com> - 2.35-16
- Fix bug running readelf on an empty file. (#1903448)
- Fix bug running readelf on a file that cannot be read. (#1913589)