From e28e96e795656bb72111d56131fba5ef7d29f34e Mon Sep 17 00:00:00 2001 From: Nick Clifton Date: Apr 20 2016 14:53:46 +0000 Subject: Import patch to fix generation of x86 relocs in PIE mode. (PR 19827) Resolves: #1302071 --- diff --git a/binutils-2.26-x86-PIE-relocations.patch b/binutils-2.26-x86-PIE-relocations.patch new file mode 100644 index 0000000..c39c3aa --- /dev/null +++ b/binutils-2.26-x86-PIE-relocations.patch @@ -0,0 +1,46 @@ +--- binutils-2.26.orig/bfd/elf32-i386.c 2016-03-18 10:04:17.245507884 +0000 ++++ binutils-2.26/bfd/elf32-i386.c 2016-03-18 10:05:59.336070167 +0000 +@@ -1830,7 +1830,8 @@ do_size: + && (sec->flags & SEC_ALLOC) != 0 + && (r_type != R_386_PC32 + || (h != NULL +- && (! SYMBOLIC_BIND (info, h) ++ && (! (bfd_link_pie (info) ++ || SYMBOLIC_BIND (info, h)) + || h->root.type == bfd_link_hash_defweak + || !h->def_regular)))) + || (ELIMINATE_COPY_RELOCS +@@ -4287,8 +4288,8 @@ r_386_got32: + else if (h != NULL + && h->dynindx != -1 + && (r_type == R_386_PC32 +- || !bfd_link_pic (info) +- || !SYMBOLIC_BIND (info, h) ++ || !(bfd_link_executable (info) ++ || SYMBOLIC_BIND (info, h)) + || !h->def_regular)) + outrel.r_info = ELF32_R_INFO (h->dynindx, r_type); + else +--- binutils-2.26.orig/bfd/elf64-x86-64.c 2016-03-18 10:04:17.244507878 +0000 ++++ binutils-2.26/bfd/elf64-x86-64.c 2016-03-18 10:06:46.686331624 +0000 +@@ -2029,7 +2029,8 @@ do_size: + && (sec->flags & SEC_ALLOC) != 0 + && (! IS_X86_64_PCREL_TYPE (r_type) + || (h != NULL +- && (! SYMBOLIC_BIND (info, h) ++ && (! (bfd_link_pie (info) ++ || SYMBOLIC_BIND (info, h)) + || h->root.type == bfd_link_hash_defweak + || !h->def_regular)))) + || (ELIMINATE_COPY_RELOCS +@@ -4631,8 +4632,8 @@ direct: + else if (h != NULL + && h->dynindx != -1 + && (IS_X86_64_PCREL_TYPE (r_type) +- || ! bfd_link_pic (info) +- || ! SYMBOLIC_BIND (info, h) ++ || !(bfd_link_executable (info) ++ || SYMBOLIC_BIND (info, h)) + || ! h->def_regular)) + { + outrel.r_info = htab->r_info (h->dynindx, r_type); diff --git a/binutils.spec b/binutils.spec index dd0ff83..abdc4c6 100644 --- a/binutils.spec +++ b/binutils.spec @@ -20,7 +20,7 @@ Summary: A GNU collection of binary utilities Name: %{?cross}binutils%{?_with_debug:-debug} Version: 2.26 -Release: 17%{?dist} +Release: 18%{?dist} License: GPLv3+ Group: Development/Tools URL: http://sources.redhat.com/binutils @@ -71,6 +71,8 @@ Patch23: binutils-2.26-common-definitions.patch # Fix compilation under broken F24 GCC, which geneerates bogus strict aliasing violations. # FIXME: Remove once GCC is fixed. Patch24: binutils-2.26-bad-aliasing.patch +# Import fix for PR 19827 +Patch25: binutils-2.26-x86-PIE-relocations.patch Provides: bundled(libiberty) @@ -203,6 +205,7 @@ using libelf instead of BFD. %patch22 -p1 %patch23 -p1 %patch24 -p1 +%patch25 -p1 # We cannot run autotools as there is an exact requirement of autoconf-2.59. @@ -522,6 +525,10 @@ exit 0 %endif # %{isnative} %changelog +* Wed Apr 20 2016 Nick Clifton 2.26-18 +- Import patch to fix generation of x86 relocs in PIE mode. (PR 19827) + (#1302071) + * Tue Mar 15 2016 Nick Clifton 2.26-17 - Fix strict aliasing errors compiling with broken F24 gcc. See thread starting here: https://sourceware.org/ml/binutils/2016-03/msg00119.html