* hppa.h (pa_opcodes): Use "cX" completer instead of "cx" in fstqx
[external/binutils.git] / ld / ldmain.c
index b2810a7..15f8ebf 100644 (file)
@@ -88,8 +88,8 @@ int g_switch_value = 8;
 /* Nonzero means print names of input files as processed.  */
 bfd_boolean trace_files;
 
-/* Nonzero means same, but note open failures, too.  */
-bfd_boolean trace_file_tries;
+/* Nonzero means report actions taken by the linker, and describe the linker script in use.  */
+bfd_boolean verbose;
 
 /* Nonzero means version number was printed, so exit successfully
    instead of complaining if no input files are given.  */
@@ -160,6 +160,8 @@ static struct bfd_link_callbacks link_callbacks =
   ldlang_override_segment_assignment
 };
 
+static bfd_assert_handler_type default_bfd_assert_handler;
+
 struct bfd_link_info link_info;
 \f
 static void
@@ -173,6 +175,17 @@ ld_cleanup (void)
     unlink_if_ordinary (output_filename);
 }
 
+/* If there's a BFD assertion, we'll notice and exit with an error
+   unless otherwise instructed.  */
+
+static void
+ld_bfd_assert_handler (const char *fmt, const char *bfdver,
+                      const char *file, int line)
+{
+  (*default_bfd_assert_handler) (fmt, bfdver, file, line);
+  config.make_executable = FALSE;
+}
+
 int
 main (int argc, char **argv)
 {
@@ -199,6 +212,11 @@ main (int argc, char **argv)
 
   bfd_set_error_program_name (program_name);
 
+  /* We want to notice and fail on those nasty BFD assertions which are
+     likely to signal incorrect output being generated but otherwise may
+     leave no trace.  */
+  default_bfd_assert_handler = bfd_set_assert_handler (ld_bfd_assert_handler);
+
   xatexit (ld_cleanup);
 
   /* Set up the sysroot directory.  */
@@ -322,7 +340,7 @@ main (int argc, char **argv)
       lex_string = NULL;
     }
 
-  if (trace_file_tries)
+  if (verbose)
     {
       if (saved_script_handle)
        info_msg (_("using external linker script:"));
@@ -843,7 +861,7 @@ add_archive_element (struct bfd_link_info *info,
        minfo ("(%s)\n", name);
     }
 
-  if (trace_files || trace_file_tries)
+  if (trace_files || verbose)
     info_msg ("%I\n", &orig_input);
   return TRUE;
 }