aboutsummaryrefslogtreecommitdiff
path: root/gas/as.c
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2022-07-07 19:56:10 +0930
committerAlan Modra <amodra@gmail.com>2022-07-09 21:20:31 +0930
commit07e64e0b7c6cd4a73220eb57588d0db6b2a192e3 (patch)
treeb21fcb73f362e326904533bdbfa648bb9dce50b3 /gas/as.c
parentc30081c1f955a9fea2da8988bab96191e3d2171e (diff)
downloadgdb-07e64e0b7c6cd4a73220eb57588d0db6b2a192e3.zip
gdb-07e64e0b7c6cd4a73220eb57588d0db6b2a192e3.tar.gz
gdb-07e64e0b7c6cd4a73220eb57588d0db6b2a192e3.tar.bz2
gas: output_file_close
This is mostly a tidy with the aim of being able to free out_file_name, but it does fix a possible attempt to unlink the output file twice (not that that matters). * as.h (keep_it): New global. * as.c (keep_it): Delete. (close_output_file): Delete, merged into.. * output-file.c (output_file_close): ..here. Delete parameter. * output-file.h (output_file_close): Update prototype.
Diffstat (limited to 'gas/as.c')
-rw-r--r--gas/as.c13
1 files changed, 1 insertions, 12 deletions
diff --git a/gas/as.c b/gas/as.c
index 0262a6f..49a4486 100644
--- a/gas/as.c
+++ b/gas/as.c
@@ -111,9 +111,6 @@ int flag_use_elf_stt_common = DEFAULT_GENERATE_ELF_STT_COMMON;
bool flag_generate_build_notes = DEFAULT_GENERATE_BUILD_NOTES;
#endif
-/* Keep the output file. */
-static int keep_it = 0;
-
segT reg_section;
segT expr_section;
segT text_section;
@@ -1155,14 +1152,6 @@ dump_statistics (void)
#endif
}
-static void
-close_output_file (void)
-{
- output_file_close (out_file_name);
- if (!keep_it)
- unlink_if_ordinary (out_file_name);
-}
-
/* The interface between the macro code and gas expression handling. */
static size_t
@@ -1361,7 +1350,7 @@ main (int argc, char ** argv)
expr_begin ();
/* It has to be called after dump_statistics (). */
- xatexit (close_output_file);
+ xatexit (output_file_close);
if (flag_print_statistics)
xatexit (dump_statistics);