summaryrefslogtreecommitdiff
path: root/gas/as.c
diff options
context:
space:
mode:
authorH.J. Lu <hjl@lucon.org>2006-02-09 00:07:41 +0000
committerH.J. Lu <hjl@lucon.org>2006-02-09 00:07:41 +0000
commit80f6f79cc2aa2a8e0ab665bf14cac13b7b67c408 (patch)
tree52e64189e567bdec7e74ddb666bf209b595642f9 /gas/as.c
parent5365282a27a6977ba2d739c9ba596c9a1e50fff8 (diff)
downloadbinutils-redhat-80f6f79cc2aa2a8e0ab665bf14cac13b7b67c408.tar.gz
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.
Diffstat (limited to 'gas/as.c')
-rw-r--r--gas/as.c17
1 files changed, 13 insertions, 4 deletions
diff --git a/gas/as.c b/gas/as.c
index 16711b1f81..727a1dd40e 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 ());