From 2c9d39bc55071a677f2ba03f59d799beea018e07 Mon Sep 17 00:00:00 2001 From: Nick Clifton Date: Tue, 6 Oct 2020 16:58:40 +0100 Subject: [PATCH] Fix strip when merging multiple same-named sections. Resolves: #1885607 --- binutils-strip-merge.patch | 19 +++++++++++++++++++ binutils.spec | 10 +++++++++- 2 files changed, 28 insertions(+), 1 deletion(-) create mode 100644 binutils-strip-merge.patch diff --git a/binutils-strip-merge.patch b/binutils-strip-merge.patch new file mode 100644 index 0000000..2453685 --- /dev/null +++ b/binutils-strip-merge.patch @@ -0,0 +1,19 @@ +--- binutils.orig/binutils/objcopy.c 2020-10-06 14:53:19.264943750 +0100 ++++ binutils-2.35.1/binutils/objcopy.c 2020-10-06 14:53:47.002761889 +0100 +@@ -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) diff --git a/binutils.spec b/binutils.spec index 8bb9bc4..1cb5f02 100644 --- a/binutils.spec +++ b/binutils.spec @@ -2,7 +2,7 @@ Summary: A GNU collection of binary utilities Name: %{?cross}binutils%{?_with_debug:-debug} Version: 2.35.1 -Release: 1%{?dist} +Release: 2%{?dist} License: GPLv3+ URL: https://sourceware.org/binutils @@ -237,6 +237,11 @@ Patch25: binutils-aarch64-condbranch-relocs.patch # Lifetime: Fixed in 2.36 Patch26: binutils-ppc-annobin-disassembly.patch +# Purpose: Fix the strip program to cope when merging multiple same-named +# sections. +# Lifetime: Fixed in 2.36 +# Patch27: binutils-strip-merge.patch + #---------------------------------------------------------------------------- Provides: bundled(libiberty) @@ -810,6 +815,9 @@ exit 0 #---------------------------------------------------------------------------- %changelog +* Tue Oct 06 2020 Nick Clifton - 2.35.1-2 +- Fix strip when merging multiple same-named sections. (#1885607) + * Mon Sep 21 2020 Nick Clifton - 2.35.1-1 - Rebase to GNU Binutils 2.35.1 release. - Retire: binutils-gas-dwarf-level-4.patch