add texinfo.tex
[deliverable/binutils-gdb.git] / ld / ldmain.c
index b392563a7ef040e875691fd87bade63eb2ae4004..1e710dbb6504cfe0937dd3c8bb294285a47ffaee 100644 (file)
@@ -1,5 +1,6 @@
 /* Main program of GNU linker.
-   Copyright (C) 1991, 92, 93, 94, 95, 96, 1997, 1998 Free Software Foundation, Inc.
+   Copyright (C) 1991, 92, 93, 94, 95, 96, 97, 98, 1999
+   Free Software Foundation, Inc.
    Written by Steve Chamberlain steve@cygnus.com
 
 This file is part of GLD, the Gnu Linker.
@@ -82,6 +83,9 @@ boolean version_printed;
 /* Nonzero means link in every member of an archive.  */
 boolean whole_archive;
 
+/* True if we should demangle symbol names.  */
+boolean demangling;
+
 args_type command_line;
 
 ld_config_type config;
@@ -162,7 +166,7 @@ main (argc, argv)
   char *emulation;
   long start_time = get_run_time ();
 
-#ifdef HAVE_SETLOCALE
+#if defined (HAVE_SETLOCALE) && defined (HAVE_LC_MESSAGES)
   setlocale (LC_MESSAGES, "");
 #endif
   bindtextdomain (PACKAGE, LOCALEDIR);
@@ -201,6 +205,13 @@ main (argc, argv)
   command_line.warn_mismatch = true;
   command_line.check_section_addresses = true;
 
+  /* We initialize DEMANGLING based on the environment variable
+     COLLECT_NO_DEMANGLE.  The gcc collect2 program will demangle the
+     output of the linker, unless COLLECT_NO_DEMANGLE is set in the
+     environment.  Acting the same way here lets us provide the same
+     interface by default.  */
+  demangling = getenv ("COLLECT_NO_DEMANGLE") == NULL;
+
   link_info.callbacks = &link_callbacks;
   link_info.relocateable = false;
   link_info.shared = false;
@@ -208,6 +219,7 @@ main (argc, argv)
   link_info.static_link = false;
   link_info.traditional_format = false;
   link_info.optimize = false;
+  link_info.no_undefined = false;
   link_info.strip = strip_none;
   link_info.discard = discard_none;
   link_info.keep_memory = true;
@@ -218,6 +230,7 @@ main (argc, argv)
   link_info.notice_all = false;
   link_info.notice_hash = NULL;
   link_info.wrap_hash = NULL;
+  link_info.mpc860c0 = 0;
   
   ldfile_add_arch ("");
 
@@ -241,7 +254,9 @@ main (argc, argv)
     {
       if (command_line.gc_sections)
        einfo ("%P%F: --gc-sections and -r may not be used together\n");
-      if (command_line.relax)
+      if (link_info.mpc860c0)
+       einfo (_("%P%F: -r and --mpc860c0 may not be used together\n"));
+      else if (command_line.relax)
        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"));
@@ -422,7 +437,6 @@ main (argc, argv)
 
   if (config.stats)
     {
-      extern char **environ;
 #ifdef HAVE_SBRK
       char *lim = (char *) sbrk (0);
 #endif
This page took 0.024005 seconds and 4 git commands to generate.