diff options
author | Ted Unangst <tedu@cvs.openbsd.org> | 2006-10-24 04:48:01 +0000 |
---|---|---|
committer | Ted Unangst <tedu@cvs.openbsd.org> | 2006-10-24 04:48:01 +0000 |
commit | dfec78c060b98b43a0e3ae824c5c6b7bcc10c98e (patch) | |
tree | ebf9fd669fca72c3b12321d2d64f68db8e717998 /gnu/usr.bin/binutils/gas | |
parent | 121c56c7a792d506d23a7e308953ea9e79863e8a (diff) |
fix a crash with --statistics. closing file in the wrong place.
from dasn. ok deraadt
Diffstat (limited to 'gnu/usr.bin/binutils/gas')
-rw-r--r-- | gnu/usr.bin/binutils/gas/as.c | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/gnu/usr.bin/binutils/gas/as.c b/gnu/usr.bin/binutils/gas/as.c index 0911aa1fa26..8b64433003a 100644 --- a/gnu/usr.bin/binutils/gas/as.c +++ b/gnu/usr.bin/binutils/gas/as.c @@ -847,6 +847,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 @@ -1033,6 +1041,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); @@ -1132,13 +1145,6 @@ main (int argc, char ** argv) listing_print (listing_filename); #endif -#ifndef OBJ_VMS /* Does its own file handling. */ -#ifndef BFD_ASSEMBLER - if (keep_it) -#endif - 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 ()); |