Fix creation of PowerPC64 function call stubs. Disable -z defs during build.

Resolves: #1523457
This commit is contained in:
Nick Clifton 2018-01-25 15:02:45 +00:00
parent f323ec1bdb
commit c61ce7af1e
2 changed files with 37 additions and 1 deletions

View File

@ -0,0 +1,22 @@
--- binutils.orig/bfd/elf64-ppc.c 2018-01-25 13:23:13.575860963 +0000
+++ binutils-2.29.1/bfd/elf64-ppc.c 2018-01-25 13:24:36.564874275 +0000
@@ -12805,6 +12805,9 @@ ppc64_elf_size_stubs (struct bfd_link_in
stub_sec->flags &= ~SEC_RELOC;
}
+ if (htab->stub_iteration <= STUB_SHRINK_ITER
+ || htab->brlt->rawsize < htab->brlt->size)
+ htab->brlt->rawsize = htab->brlt->size;
htab->brlt->size = 0;
htab->brlt->reloc_count = 0;
htab->brlt->flags &= ~SEC_RELOC;
@@ -12858,6 +12861,9 @@ ppc64_elf_size_stubs (struct bfd_link_in
break;
if (group == NULL
+ && (htab->brlt->rawsize == htab->brlt->size
+ || (htab->stub_iteration > STUB_SHRINK_ITER
+ && htab->brlt->rawsize > htab->brlt->size))
&& (htab->glink_eh_frame == NULL
|| htab->glink_eh_frame->rawsize == htab->glink_eh_frame->size))
break;

View File

@ -49,12 +49,18 @@
%define enable_shared 0
%endif
# The opcodes library needs a few functions defined in the bfd
# library, but these symbols are not defined in the stub bfd .so
# that is available at link time. (They are present in the real
# .so that is used at run time).
%undefine _strict_symbol_defs_build
#----------------------------------------------------------------------------
Summary: A GNU collection of binary utilities
Name: %{?cross}binutils%{?_with_debug:-debug}
Version: 2.29.1
Release: 13%{?dist}
Release: 14%{?dist}
License: GPLv3+
Group: Development/Tools
URL: https://sourceware.org/binutils
@ -164,6 +170,10 @@ Patch14: binutils-z-undefs.patch
# Lifetime: Fixed in 2.30.
Patch15: binutils-aarch64-pie.patch
# Purpose: Fixes the creation of function call stubs for PowerPC64.
# Lifetime: Fixed in 2.31. See BZ 1523457
Patch16: binutils-ppc64-stub-creation.patch
#----------------------------------------------------------------------------
Provides: bundled(libiberty)
@ -301,6 +311,7 @@ using libelf instead of BFD.
%patch13 -p1
%patch14 -p1
%patch15 -p1
%patch16 -p1
# We cannot run autotools as there is an exact requirement of autoconf-2.59.
@ -705,6 +716,9 @@ exit 0
#----------------------------------------------------------------------------
%changelog
* Thu Jan 25 2018 Nick Clifton <nickc@redhat.com> 2.29.1-14
- Fix creation of PowerPC64 function call stubs. (#1523457)
* Mon Jan 22 2018 Nick Clifton <nickc@redhat.com> 2.29.1-13
- Fix bugs in AArch64 static PIE support. (#1536645)