From 0d47446427843e4f69a7ffbc0fe39341e3ff8f6a Mon Sep 17 00:00:00 2001
From: "H.J. Lu" <hjl.tools@gmail.com>
Date: Thu, 9 Feb 2006 00:07:41 +0000
Subject: 2006-02-08  H.J. Lu  <hongjiu.lu@intel.com>

	* as.c (close_output_file): New.
	(main): Register close_output_file with xatexit before
	dump_statistics. Don't call output_file_close.
---
 gas/ChangeLog |  6 ++++++
 gas/as.c      | 17 +++++++++++++----
 2 files changed, 19 insertions(+), 4 deletions(-)

(limited to 'gas')

diff --git a/gas/ChangeLog b/gas/ChangeLog
index 6877ccb..3574590 100644
--- a/gas/ChangeLog
+++ b/gas/ChangeLog
@@ -1,3 +1,9 @@
+2006-02-08  H.J. Lu  <hongjiu.lu@intel.com>
+
+	* as.c (close_output_file): New.
+	(main): Register close_output_file with xatexit before
+	dump_statistics. Don't call output_file_close.
+
 2006-02-07  Nathan Sidwell  <nathan@codesourcery.com>
 
 	* config/tc-m68k.c (mcf5208_control_regs, mcf5213_control_regs,
diff --git a/gas/as.c b/gas/as.c
index 16711b1..727a1dd 100644
--- a/gas/as.c
+++ b/gas/as.c
@@ -930,6 +930,14 @@ dump_statistics (void)
 #endif
 }
 
+#ifndef OBJ_VMS
+static void
+close_output_file (void)
+{
+  output_file_close (out_file_name);
+}
+#endif
+
 /* The interface between the macro code and gas expression handling.  */
 
 static int
@@ -1081,6 +1089,11 @@ main (int argc, char ** argv)
   input_scrub_begin ();
   expr_begin ();
 
+#ifndef OBJ_VMS /* Does its own file handling.  */
+  /* It has to be called after dump_statistics ().  */
+  xatexit (close_output_file);
+#endif
+
   if (flag_print_statistics)
     xatexit (dump_statistics);
 
@@ -1169,10 +1182,6 @@ main (int argc, char ** argv)
   listing_print (listing_filename);
 #endif
 
-#ifndef OBJ_VMS /* Does its own file handling.  */
-  output_file_close (out_file_name);
-#endif
-
   if (flag_fatal_warnings && had_warnings () > 0 && had_errors () == 0)
     as_bad (_("%d warnings, treating warnings as errors"), had_warnings ());
 
-- 
cgit v1.1