Add --warn-drop-version option; by default, do not warn when discarding version info.

gold/
	PR gold/23455
	* options.h (General_options): Add --warn-drop-version option.
	* symtab.cc (Symbol_table::set_dynsym_indexes): Check it.
This commit is contained in:
Cary Coutant 2018-08-06 14:08:48 -07:00
parent a7f25a84f4
commit 3a12c78d14
3 changed files with 16 additions and 5 deletions

View File

@ -1,3 +1,9 @@
2018-08-06 Cary Coutant <ccoutant@gmail.com>
PR gold/23455
* options.h (General_options): Add --warn-drop-version option.
* symtab.cc (Symbol_table::set_dynsym_indexes): Check it.
2018-08-06 Cary Coutant <ccoutant@gmail.com>
* target.h (Sized_target::record_gnu_property): Change first two

View File

@ -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"));

View File

@ -2623,6 +2623,7 @@ Symbol_table::set_dynsym_indexes(unsigned int index,
versions->record_version(this, dynpool, sym);
else
{
if (parameters->options().warn_drop_version())
gold_warning(_("discarding version information for "
"%s@%s, defined in unused shared library %s "
"(linked with --as-needed)"),