Stop gold from warning about discard version information unless explicitly requested.

Resolves: #1654153
This commit is contained in:
Nick Clifton 2018-11-28 14:18:00 +00:00
parent b094c0da4a
commit fde96c9add
2 changed files with 45 additions and 1 deletions

View File

@ -0,0 +1,35 @@
diff -rup binutils.orig/gold/options.h binutils-2.31.1/gold/options.h
--- binutils.orig/gold/options.h 2018-11-28 13:43:45.192094029 +0000
+++ binutils-2.31.1/gold/options.h 2018-11-28 13:44:30.616758345 +0000
@@ -1358,6 +1358,10 @@ class General_options
N_("Warn about duplicate common symbols"),
N_("Do not warn about duplicate common symbols"));
+ DEFINE_bool(warn_drop_version, options::TWO_DASHES, '\0', false,
+ N_("Warn when discarding version information"),
+ N_("Do not warn when discarding version information"));
+
DEFINE_bool_ignore(warn_constructors, options::TWO_DASHES, '\0',
N_("Ignored"), N_("Ignored"));
diff -rup binutils.orig/gold/symtab.cc binutils-2.31.1/gold/symtab.cc
--- binutils.orig/gold/symtab.cc 2018-11-28 13:43:45.193094021 +0000
+++ binutils-2.31.1/gold/symtab.cc 2018-11-28 13:45:13.479441595 +0000
@@ -2623,11 +2623,12 @@ Symbol_table::set_dynsym_indexes(unsigne
versions->record_version(this, dynpool, sym);
else
{
- gold_warning(_("discarding version information for "
- "%s@%s, defined in unused shared library %s "
- "(linked with --as-needed)"),
- sym->name(), sym->version(),
- sym->object()->name().c_str());
+ if (parameters->options().warn_drop_version())
+ gold_warning(_("discarding version information for "
+ "%s@%s, defined in unused shared library %s "
+ "(linked with --as-needed)"),
+ sym->name(), sym->version(),
+ sym->object()->name().c_str());
sym->clear_version();
}
}

View File

@ -69,7 +69,7 @@
Summary: A GNU collection of binary utilities
Name: %{?cross}binutils%{?_with_debug:-debug}
Version: 2.31.1
Release: 16%{?dist}
Release: 17%{?dist}
License: GPLv3+
URL: https://sourceware.org/binutils
@ -207,6 +207,11 @@ Patch22: binutils-CVE-2018-17358.patch
# Lifetime: Might be fixed in 2.32
Patch23: binutils-special-sections-in-groups.patch
# Purpose: Stop gold from issuing warnings about dropped version
# information, unless explicitly requested otherwise.
# Lifetime: Fixed in 2.32
Patch24: binutils-gold-discard-version-info.patch
#----------------------------------------------------------------------------
Provides: bundled(libiberty)
@ -352,6 +357,7 @@ using libelf instead of BFD.
%patch21 -p1
%patch22 -p1
%patch23 -p1
%patch24 -p1
# We cannot run autotools as there is an exact requirement of autoconf-2.59.
# FIXME - this is no longer true. Maybe try reinstating autotool use ?
@ -775,6 +781,9 @@ exit 0
#----------------------------------------------------------------------------
%changelog
* Wed Nov 28 2018 Nick Clifton <nickc@redhat.com> - 2.31.1-17
- Stop gold from warning about discard version information unless explicitly requested. (#1654153)
* Thu Nov 15 2018 Nick Clifton <nickc@redhat.com> - 2.31.1-16
- Remove debugging fprintf statement accidentally left in patch. (#1645828)