From bc6d877ace8e7bcd308a6cd267c15a7285683620 Mon Sep 17 00:00:00 2001 From: Nick Clifton Date: Mon, 22 Jul 2019 14:19:11 +0100 Subject: [PATCH] Stops the linker from merging section groups with different SHF_EXCLUDE flags. Resolves: #1730906 --- ...ot-merge-differing-SHF_EXCLUDE-groups.patch | 18 ++++++++++++++++++ binutils.spec | 10 +++++++++- 2 files changed, 27 insertions(+), 1 deletion(-) create mode 100644 binutils-do-not-merge-differing-SHF_EXCLUDE-groups.patch diff --git a/binutils-do-not-merge-differing-SHF_EXCLUDE-groups.patch b/binutils-do-not-merge-differing-SHF_EXCLUDE-groups.patch new file mode 100644 index 0000000..e0653f9 --- /dev/null +++ b/binutils-do-not-merge-differing-SHF_EXCLUDE-groups.patch @@ -0,0 +1,18 @@ +--- binutils.orig/ld/emultempl/elf32.em 2019-07-22 13:25:51.601030174 +0100 ++++ binutils-2.32/ld/emultempl/elf32.em 2019-07-22 13:27:36.070394830 +0100 +@@ -2029,10 +2029,12 @@ elf_orphan_compatible (asection *in, ase + if (elf_section_data (out)->this_hdr.sh_info + != elf_section_data (in)->this_hdr.sh_info) + return FALSE; +- /* We can't merge two sections with differing SHF_EXCLUDE when doing +- a relocatable link. */ ++ /* We can't merge with member of output section group nor merge two ++ sections with differing SHF_EXCLUDE when doing a relocatable link. */ + if (bfd_link_relocatable (&link_info) +- && ((elf_section_flags (out) ^ elf_section_flags (in)) & SHF_EXCLUDE) != 0) ++ && (elf_next_in_group (out) != NULL ++ || ((elf_section_flags (out) ^ elf_section_flags (in)) ++ & SHF_EXCLUDE) != 0)) + return FALSE; + return _bfd_elf_match_sections_by_type (link_info.output_bfd, out, + in->owner, in); diff --git a/binutils.spec b/binutils.spec index c2bc8a5..31ae338 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.32 -Release: 17%{?dist} +Release: 18%{?dist} License: GPLv3+ URL: https://sourceware.org/binutils @@ -230,6 +230,10 @@ Patch22: binutils-gas-build-note-relocs.patch # Lifetime: Fixed in 2.33 Patch23: binutils-do-not-warn-about-debuginfo-files.patch +# Purpose: Stops the linker from merging section groups with different exclusion flags. +# Lifetime: Fixed in 2.33 +Patch24: binutils-do-not-merge-differing-SHF_EXCLUDE-groups.patch + #---------------------------------------------------------------------------- Provides: bundled(libiberty) @@ -379,6 +383,7 @@ Conflicts: gcc-c++ < 4.0.0 %patch21 -p1 %patch22 -p1 %patch23 -p1 +%patch24 -p1 # We cannot run autotools as there is an exact requirement of autoconf-2.59. # FIXME - this is no longer true. Maybe try reinstating autotool use ? @@ -775,6 +780,9 @@ exit 0 #---------------------------------------------------------------------------- %changelog +* Mon Jul 22 2019 Nick Clifton - 2.32-18 +- Stops the linker from merging section groups with different SHF_EXCLUDE flags. (#1730906) + * Tue Jul 02 2019 Nick Clifton - 2.32-17 - Stop the BFD library from complaining about sections found inside debuginfo files. (PR 24717)