From 5864e0974d514a33542ca4d4bbccf197f1b72580 Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Tue, 27 Oct 1998 00:07:26 +0000 Subject: [PATCH] (main): Initialize link_info.optimze to false. --- ld/ldmain.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/ld/ldmain.c b/ld/ldmain.c index ec4086a05e5..96f32799e4d 100644 --- a/ld/ldmain.c +++ b/ld/ldmain.c @@ -162,7 +162,9 @@ main (argc, argv) char *emulation; long start_time = get_run_time (); +#ifdef HAVE_SETLOCALE setlocale (LC_MESSAGES, ""); +#endif bindtextdomain (PACKAGE, LOCALEDIR); textdomain (PACKAGE); @@ -192,6 +194,7 @@ main (argc, argv) whole_archive = false; config.build_constructors = true; config.dynamic_link = false; + config.has_shared = false; command_line.force_common_definition = false; command_line.interpreter = NULL; command_line.rpath = NULL; @@ -203,6 +206,7 @@ main (argc, argv) link_info.symbolic = false; link_info.static_link = false; link_info.traditional_format = false; + link_info.optimize = false; link_info.strip = strip_none; link_info.discard = discard_none; link_info.keep_memory = true; @@ -234,12 +238,17 @@ main (argc, argv) if (link_info.relocateable) { + if (command_line.gc_sections) + einfo ("%P%F: --gc-sections and -r may not be used together\n"); if (command_line.relax) - einfo (_("%P%F: -relax and -r may not be used together\n")); + einfo (_("%P%F: --relax and -r may not be used together\n")); if (link_info.shared) einfo (_("%P%F: -r and -shared may not be used together\n")); } + if (command_line.gc_sections && config.dynamic_link) + einfo("%P%F: --gc-sections may only be performed for static links\n"); + /* Treat ld -r -s as ld -r -S -x (i.e., strip all local symbols). I don't see how else this can be handled, since in this case we must preserve all externally visible symbols. */ -- 2.30.2