Stops the linker from merging section groups with different SHF_EXCLUDE flags.

Resolves: #1730906
This commit is contained in:
Nick Clifton 2019-07-22 14:19:11 +01:00
parent cbe88f3d8f
commit bc6d877ace
2 changed files with 27 additions and 1 deletions

View File

@ -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);

View File

@ -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 <nickc@redhat.com> - 2.32-18
- Stops the linker from merging section groups with different SHF_EXCLUDE flags. (#1730906)
* Tue Jul 02 2019 Nick Clifton <nickc@redhat.com> - 2.32-17
- Stop the BFD library from complaining about sections found inside debuginfo files. (PR 24717)