gold patch committed: Add --warn-constructors

View: New views
1 Messages — Rating Filter:   Alert me  

gold patch committed: Add --warn-constructors

by Ian Lance Taylor-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

The GNU linker accepts a --warn-constructors option.  For ELF, it
essentially ignores it.  I added this as an option to gold.

It would be possible to make this warning meaningful for ELF, by
warning about __GLOBAL__I__xxx symbols, or perhaps about a non-empty
.ctors section.  However, I don't think such a warning would be
particularly useful these days, so since GNU ld doesn't warn, gold
doesn't warn either.

Ian


2009-11-03  Ian Lance Taylor  <iant@...>

        * options.h (class General_options): Add --warn_constructors.



Index: options.h
===================================================================
RCS file: /cvs/src/src/gold/options.h,v
retrieving revision 1.115
diff -p -u -r1.115 options.h
--- options.h 28 Oct 2009 00:42:34 -0000 1.115
+++ options.h 3 Nov 2009 15:55:26 -0000
@@ -918,6 +918,9 @@ class General_options
   DEFINE_special(version_script, options::TWO_DASHES, '\0',
                  N_("Read version script"), N_("FILE"));
 
+  DEFINE_bool(warn_constructors, options::TWO_DASHES, '\0', false,
+      N_("Ignored"), N_("Ignored"));
+
   DEFINE_bool(warn_search_mismatch, options::TWO_DASHES, '\0', true,
       N_("Warn when skipping an incompatible library"),
       N_("Don't warn when skipping an incompatible library"));