Import fix for PR 23870 in order to help building Go binaries.

This commit is contained in:
Nick Clifton 2019-05-21 12:17:54 +01:00
commit cf9ca85548
2 changed files with 30 additions and 1 deletions

View file

@ -0,0 +1,20 @@
--- binutils.orig/gold/aarch64.cc 2019-05-21 11:24:07.642560743 +0100
+++ binutils-2.32/gold/aarch64.cc 2019-05-21 11:25:02.425157682 +0100
@@ -6496,6 +6496,17 @@ Target_aarch64<size, big_endian>::Scan::
gold_error(_("%s: unsupported reloc %u in pos independent link."),
object->name().c_str(), r_type);
}
+ // Make a PLT entry if necessary.
+ if (gsym->needs_plt_entry())
+ {
+ target->make_plt_entry(symtab, layout, gsym);
+ // Since this is not a PC-relative relocation, we may be
+ // taking the address of a function. In that case we need to
+ // set the entry in the dynamic symbol table to the address of
+ // the PLT entry.
+ if (gsym->is_from_dynobj() && !parameters->options().shared())
+ gsym->set_needs_dynsym_value();
+ }
break;
case elfcpp::R_AARCH64_LD_PREL_LO19: // 273

View file

@ -69,7 +69,7 @@
Summary: A GNU collection of binary utilities
Name: %{?cross}binutils%{?_with_debug:-debug}
Version: 2.31.1
Release: 26%{?dist}
Release: 27%{?dist}
License: GPLv3+
URL: https://sourceware.org/binutils
@ -235,6 +235,11 @@ Patch28: binutils-x86-no-scale-8bit-displacements.patch
# Lifetime: Fixed in 2.33
Patch29: binutils-CVE-2019-9071.patch
# Purpose: Have the GOLD linker for AArch64 generate PLT entries for MOVW_ABS
# relocations if necessary.
# Lifetime: Fixed in 2.33
Patch30: binutils-aarch64-gold-PLT-for-MOVW_ABS.patch
#----------------------------------------------------------------------------
Provides: bundled(libiberty)
@ -387,6 +392,7 @@ using libelf instead of BFD.
%patch27 -p1
%patch28 -p1
%patch29 -p1
%patch30 -p1
# We cannot run autotools as there is an exact requirement of autoconf-2.59.
@ -794,6 +800,9 @@ exit 0
#----------------------------------------------------------------------------
%changelog
* Tue May 21 2019 Nick Clifton <nickc@redhat.com> - 2.31.1-27
- Import fix for PR 23870 in order to help building Go binaries.
* Wed Apr 10 2019 Nick Clifton <nickc@redhat.com> - 2.31.1-26
- Fix a stack exhaustion problem in libiberty's name demangling code. (#1680658)