Import patch to fix generation of x86 relocs in PIE mode. (PR 19827)

This commit is contained in:
Nick Clifton 2016-03-18 10:18:50 +00:00
parent 712d1262f6
commit 2fa80847e2
2 changed files with 53 additions and 1 deletions

View File

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

View File

@ -20,7 +20,7 @@
Summary: A GNU collection of binary utilities Summary: A GNU collection of binary utilities
Name: %{?cross}binutils%{?_with_debug:-debug} Name: %{?cross}binutils%{?_with_debug:-debug}
Version: 2.26 Version: 2.26
Release: 15%{?dist} Release: 16%{?dist}
License: GPLv3+ License: GPLv3+
Group: Development/Tools Group: Development/Tools
URL: http://sources.redhat.com/binutils URL: http://sources.redhat.com/binutils
@ -68,6 +68,8 @@ Patch21: binutils-rh1312151.patch
Patch22: binutils-2.26-fix-GOT-offset-calculation.patch Patch22: binutils-2.26-fix-GOT-offset-calculation.patch
# Import fix for PR 19579 # Import fix for PR 19579
Patch23: binutils-2.26-common-definitions.patch Patch23: binutils-2.26-common-definitions.patch
# Import fix for PR 19827
Patch24: binutils-2.26-x86-PIE-relocations.patch
Provides: bundled(libiberty) Provides: bundled(libiberty)
@ -199,6 +201,7 @@ using libelf instead of BFD.
%patch21 -p1 %patch21 -p1
%patch22 -p1 %patch22 -p1
%patch23 -p1 %patch23 -p1
%patch24 -p1
# We cannot run autotools as there is an exact requirement of autoconf-2.59. # We cannot run autotools as there is an exact requirement of autoconf-2.59.
@ -518,6 +521,9 @@ exit 0
%endif # %{isnative} %endif # %{isnative}
%changelog %changelog
* Fri Mar 18 2016 Nick Clifton <nickc@redhat.com> 2.26-16
- Import patch to fix generation of x86 relocs in PIE mode. (PR 19827)
* Mon Mar 14 2016 Nick Clifton <nickc@redhat.com> 2.26-15 * Mon Mar 14 2016 Nick Clifton <nickc@redhat.com> 2.26-15
- Import patch to have common symbols in an executable override definitions in shared objects (PR 19579) - Import patch to have common symbols in an executable override definitions in shared objects (PR 19579)
(#1312507) (#1312507)