From 26acb12d22b56b81b4f34959582bb150852dc7da Mon Sep 17 00:00:00 2001 From: Nick Clifton Date: Thu, 22 Mar 2018 17:29:42 +0000 Subject: [PATCH] Fix the GOLD linker's processing of protected symbols created by the LLVM plugin. Resolves: #1559234 --- binutils-gold-llvm-plugin.patch | 16 ++++++++++++++++ binutils.spec | 11 ++++++++++- 2 files changed, 26 insertions(+), 1 deletion(-) create mode 100644 binutils-gold-llvm-plugin.patch diff --git a/binutils-gold-llvm-plugin.patch b/binutils-gold-llvm-plugin.patch new file mode 100644 index 0000000..d6d3a7e --- /dev/null +++ b/binutils-gold-llvm-plugin.patch @@ -0,0 +1,16 @@ +--- binutils.orig/gold/resolve.cc 2018-03-22 16:52:11.746513638 +0000 ++++ binutils-2.30/gold/resolve.cc 2018-03-22 16:53:58.038192419 +0000 +@@ -265,10 +265,13 @@ Symbol_table::resolve(Sized_symbol + return; + + // Likewise for an absolute symbol defined twice with the same value. ++ // Plugin-symbols are always absolute with same value here, so ignore those. + if (!is_ordinary + && st_shndx == elfcpp::SHN_ABS + && !to_is_ordinary + && to_shndx == elfcpp::SHN_ABS ++ && object->pluginobj() == NULL ++ && to->object()->pluginobj() == NULL + && to->value() == sym.get_st_value()) + return; + diff --git a/binutils.spec b/binutils.spec index 0af8520..9a3c953 100644 --- a/binutils.spec +++ b/binutils.spec @@ -62,7 +62,7 @@ Summary: A GNU collection of binary utilities Name: %{?cross}binutils%{?_with_debug:-debug} Version: 2.30 -Release: 13%{?dist} +Release: 14%{?dist} License: GPLv3+ Group: Development/Tools URL: https://sourceware.org/binutils @@ -189,6 +189,11 @@ Patch17: binutils-ifunc-relocs-in-notes.patch # Lifetime: Fixed in 2.31. Patch18: binutils-debug-section-marking.patch +# Purpose: Fix the GOLD linker's handling of PROTECTED symbols from the +# LLVM plugin. +# Lifetime: Fixed in 2.31 (probably - check...). +Patch19: binutils-gold-llvm-plugin.patch + #---------------------------------------------------------------------------- Provides: bundled(libiberty) @@ -332,6 +337,7 @@ using libelf instead of BFD. %patch16 -p1 %patch17 -p1 %patch18 -p1 +%patch19 -p1 # We cannot run autotools as there is an exact requirement of autoconf-2.59. @@ -740,6 +746,9 @@ exit 0 #---------------------------------------------------------------------------- %changelog +* Thu Mar 22 2018 Nick Clifton 2.30-14 +- Fix the GOLD linker's processing of protected symbols created by the LLVM plugin. (#1559234 and PR 22868) + * Wed Mar 14 2018 Nick Clifton 2.30-13 - Do not discard debugobj files created by GCC v8 LTO wrapper. (#1543912 and RHBZ 84847 and PR 20882)