aboutsummaryrefslogtreecommitdiff
path: root/gold
diff options
context:
space:
mode:
authorCary Coutant <ccoutant@gmail.com>2018-08-06 14:08:48 -0700
committerCary Coutant <ccoutant@gmail.com>2018-08-06 14:10:42 -0700
commitb7991db94c9dabb42a7a0fc5b0a0fb1997d85586 (patch)
treef8dc714831dbf75fcc4368bd192cf4f5174957fd /gold
parentdbf924a63a80f7044f491a09c0df6fe51a07e05e (diff)
downloadgdb-b7991db94c9dabb42a7a0fc5b0a0fb1997d85586.zip
gdb-b7991db94c9dabb42a7a0fc5b0a0fb1997d85586.tar.gz
gdb-b7991db94c9dabb42a7a0fc5b0a0fb1997d85586.tar.bz2
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.
Diffstat (limited to 'gold')
-rw-r--r--gold/ChangeLog6
-rw-r--r--gold/options.h4
-rw-r--r--gold/symtab.cc11
3 files changed, 16 insertions, 5 deletions
diff --git a/gold/ChangeLog b/gold/ChangeLog
index 9ab8c78..cf998d9 100644
--- a/gold/ChangeLog
+++ b/gold/ChangeLog
@@ -1,5 +1,11 @@
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
parameters to unsigned int.
* x86_64.cc (Target_x86_64::record_gnu_property): Likewise.
diff --git a/gold/options.h b/gold/options.h
index 98d6be8..1105498 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 aa76441..759e0d0 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();
}
}