Call bfd_cache_close_all on error

2011-08-04  H.J. Lu  <hongjiu.lu@intel.com>

	PR gas/13056
	* output-file.c (output_file_close): Call bfd_cache_close_all
	on error.

	* write.c (write_object_file): Revert the last change.
This commit is contained in:
H.J. Lu
2011-08-04 20:53:58 +00:00
parent 4309cbf2b1
commit 2ae0848317
3 changed files with 13 additions and 3 deletions

View File

@ -59,7 +59,10 @@ output_file_close (char *filename)
return;
/* Close the bfd. */
res = bfd_close (stdoutput);
if (had_errors ())
res = bfd_cache_close_all ();
else
res = bfd_close (stdoutput);
/* Prevent an infinite loop - if the close failed we will call as_fatal
which will call xexit() which may call this function again... */