This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
[gold commit] PR 23455: Don't warn by default when discarding version info
- From: ccoutant at gmail dot com
- To: binutils at sourceware dot org
- Date: Mon, 06 Aug 2018 14:13:33 -0700
- Subject: [gold commit] PR 23455: Don't warn by default when discarding version info
This patch adds a --warn-drop-version option, and gold will only print
the warning about discarding version info if the option is used.
-cary
2018-08-06 Cary Coutant <ccoutant@gmail.com>
gold/
PR gold/23455
* options.h (General_options): Add --warn-drop-version option.
* symtab.cc (Symbol_table::set_dynsym_indexes): Check it.
diff --git a/gold/options.h b/gold/options.h
index 98d6be8009..11054981c9 100644
--- a/gold/options.h
+++ b/gold/options.h
@@ -1361,6 +1361,10 @@ class General_options
DEFINE_bool_ignore(warn_constructors, options::TWO_DASHES, '\0',
N_("Ignored"), N_("Ignored"));
+ 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(warn_execstack, options::TWO_DASHES, '\0', false,
N_("Warn if the stack is executable"),
N_("Do not warn if the stack is executable"));
diff --git a/gold/symtab.cc b/gold/symtab.cc
index aa7644156f..759e0d0222 100644
--- a/gold/symtab.cc
+++ b/gold/symtab.cc
@@ -2623,11 +2623,12 @@ Symbol_table::set_dynsym_indexes(unsigned int index,
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();
}
}