* ld.h (ld_config_type): Add field warn_constructors.
authorIan Lance Taylor <ian@airs.com>
Mon, 10 Jul 1995 22:16:12 +0000 (22:16 +0000)
committerIan Lance Taylor <ian@airs.com>
Mon, 10 Jul 1995 22:16:12 +0000 (22:16 +0000)
* ldmain.c (add_to_set): Warn if config.warn_constructors.
(constructor_callback): Likewise.
* lexsup.c (parse_args): Handle -warn-constructors.
* ld.texinfo, ld.1: Document -warn-constructors.
PR 7406.

ld/ld.1

diff --git a/ld/ld.1 b/ld/ld.1
index ce5f2443e8b172ec8f87eb148c1890f9c785c281..72ace8f0820c965be48280e1fa418559a509d7bb 100644 (file)
--- a/ld/ld.1
+++ b/ld/ld.1
@@ -1,4 +1,4 @@
-.\" Copyright (c) 1991, 1992 Free Software Foundation
+.\" Copyright (c) 1991, 92, 93, 94, 1995 Free Software Foundation
 .\" See section COPYING for conditions for redistribution
 .TH ld 1 "17 August 1992" "cygnus support" "GNU Development Tools"
 .de BP
 .\" See section COPYING for conditions for redistribution
 .TH ld 1 "17 August 1992" "cygnus support" "GNU Development Tools"
 .de BP
@@ -111,6 +111,7 @@ ld \- the GNU linker
 .RB "[\|" \-\-verbose "\|]"
 .RB "[\|" \-\-version "\|]"
 .RB "[\|" \-warn\-common "\|]" 
 .RB "[\|" \-\-verbose "\|]"
 .RB "[\|" \-\-version "\|]"
 .RB "[\|" \-warn\-common "\|]" 
+.RB "[\|" \-warn\-constructors "\|]" 
 .RB "[\|" \-warn\-once "\|]" 
 .RB "[\|" \-\-whole\-archive "\|]" 
 .RB "[\|" \-X "\|]" 
 .RB "[\|" \-warn\-once "\|]" 
 .RB "[\|" \-\-whole\-archive "\|]" 
 .RB "[\|" \-X "\|]" 
@@ -851,6 +852,12 @@ a symbol definition.  Unix linkers allow this somewhat sloppy practice,
 but linkers on some other operating systems do not.  This option allows
 you to find potential problems from combining global symbols.
 
 but linkers on some other operating systems do not.  This option allows
 you to find potential problems from combining global symbols.
 
+.TP
+.B \-warn\-constructors
+Warn if any global constructors are used.  This is only useful for a
+few object file formats.  For formats like COFF or ELF, the linker can
+not detect the use of global constructors.
+
 .TP
 .B \-warn\-once
 Only warn once for each undefined symbol, rather than once per module
 .TP
 .B \-warn\-once
 Only warn once for each undefined symbol, rather than once per module