Extend fix for PR 21884.

Resolves: #1491023
This commit is contained in:
Nick Clifton 2017-09-15 10:40:04 +01:00
parent 6f94723798
commit f9311f0bfc
2 changed files with 35 additions and 1 deletions

View File

@ -115,3 +115,33 @@
&& (flags & SEC_LOAD) != 0)
place = &hold[orphan_rel];
else if ((flags & SEC_CODE) == 0)
diff -rup binutils.orig/bfd/elf32-i386.c binutils-2.29/bfd/elf32-i386.c
--- binutils.orig/bfd/elf32-i386.c 2017-09-15 10:27:16.828950825 +0100
+++ binutils-2.29/bfd/elf32-i386.c 2017-09-15 10:27:38.962692771 +0100
@@ -6921,8 +6921,9 @@ elf_i386_link_setup_gnu_properties (stru
for (abfd = info->input_bfds;
abfd != NULL;
abfd = abfd->link.next)
- if ((abfd->flags
- & (DYNAMIC | BFD_LINKER_CREATED | BFD_PLUGIN)) == 0)
+ if (bfd_get_flavour (abfd) == bfd_target_elf_flavour
+ && (abfd->flags
+ & (DYNAMIC | BFD_LINKER_CREATED | BFD_PLUGIN)) == 0)
{
htab->elf.dynobj = abfd;
dynobj = abfd;
diff -rup binutils.orig/bfd/elf64-x86-64.c binutils-2.29/bfd/elf64-x86-64.c
--- binutils.orig/bfd/elf64-x86-64.c 2017-09-15 10:27:16.820950918 +0100
+++ binutils-2.29/bfd/elf64-x86-64.c 2017-09-15 10:28:02.621416935 +0100
@@ -7466,8 +7466,9 @@ error_alignment:
for (abfd = info->input_bfds;
abfd != NULL;
abfd = abfd->link.next)
- if ((abfd->flags
- & (DYNAMIC | BFD_LINKER_CREATED | BFD_PLUGIN)) == 0)
+ if (bfd_get_flavour (abfd) == bfd_target_elf_flavour
+ && (abfd->flags
+ & (DYNAMIC | BFD_LINKER_CREATED | BFD_PLUGIN)) == 0)
{
htab->elf.dynobj = abfd;
dynobj = abfd;

View File

@ -54,7 +54,7 @@
Summary: A GNU collection of binary utilities
Name: %{?cross}binutils%{?_with_debug:-debug}
Version: 2.29
Release: 8%{?dist}
Release: 9%{?dist}
License: GPLv3+
Group: Development/Tools
URL: http://sources.redhat.com/binutils
@ -655,6 +655,10 @@ exit 0
#---------------------------------------------------------------------------------
%changelog
* Thu Sep 14 2017 Nick Clifton <nickc@redhat.com> 2.29-10
- Extend fix for PR 21884.
(#1491023)
* Thu Sep 14 2017 Nick Clifton <nickc@redhat.com> 2.29-8
- Import fix for PR 21884 which stops a seg-fault in the linker when changing output format to binary during a final link.
(#1491023)