]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
Add --warn-drop-version option; by default, do not warn when discarding version info.
authorCary Coutant <ccoutant@gmail.com>
Mon, 6 Aug 2018 21:08:48 +0000 (14:08 -0700)
committerCary Coutant <ccoutant@gmail.com>
Mon, 6 Aug 2018 21:10:13 +0000 (14:10 -0700)
gold/
PR gold/23455
* options.h (General_options): Add --warn-drop-version option.
* symtab.cc (Symbol_table::set_dynsym_indexes): Check it.

gold/ChangeLog
gold/options.h
gold/symtab.cc

index befa832b1192fb4033ac88879e48edfdd31b7efd..38f06ea919238925337b697387467ad8beed6d97 100644 (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
index 98d6be8009248f3f4bbf9c365f96644bbc119c77..11054981c9ab6a153fa4ed47cbf4c70bbbc97720 100644 (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"));
index aa7644156f5eca85ad908fb68c974a641277709c..759e0d0222f38cd17905d35555f223e4e8bc1e75 100644 (file)
@@ -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();
                }
            }