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;
#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
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);
/* name of emitted object file */
COMMON const char *out_file_name;
+/* Keep the output file. */
+COMMON int keep_it;
+
/* name of file defining extensions to the basic instruction set */
COMMON char *insttbl_file_name;
}
void
-output_file_close (const char *filename)
+output_file_close (void)
{
bool res;
bfd *obfd = stdoutput;
struct obstack **obs;
asection *sec;
+ const char *filename;
if (obfd == NULL)
return;
else
res = bfd_close (obfd);
+ filename = out_file_name;
+ out_file_name = NULL;
+ if (!keep_it && filename)
+ unlink_if_ordinary (filename);
+
subsegs_end (obs);
- if (! res)
+ if (!res)
as_fatal ("%s: %s", filename, bfd_errmsg (bfd_get_error ()));
}
the Free Software Foundation, 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */
void output_file_append (char *where, long length, char *filename);
-void output_file_close (const char *filename);
+void output_file_close (void);
void output_file_create (const char *name);
/* end of output-file.h */