aboutsummaryrefslogtreecommitdiff
path: root/gas/output-file.c
diff options
context:
space:
mode:
authorH.J. Lu <hjl.tools@gmail.com>2011-08-04 20:53:58 +0000
committerH.J. Lu <hjl.tools@gmail.com>2011-08-04 20:53:58 +0000
commit2ae0848317a2855dc97745d7be0a9edccbae90e0 (patch)
tree6acf1789f8ddb873c3188741fba416926e2628b9 /gas/output-file.c
parent4309cbf2b121cd331d5ed2910329f369d851f1bf (diff)
downloadgdb-2ae0848317a2855dc97745d7be0a9edccbae90e0.zip
gdb-2ae0848317a2855dc97745d7be0a9edccbae90e0.tar.gz
gdb-2ae0848317a2855dc97745d7be0a9edccbae90e0.tar.bz2
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.
Diffstat (limited to 'gas/output-file.c')
-rw-r--r--gas/output-file.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/gas/output-file.c b/gas/output-file.c
index e993033..3e871f0 100644
--- a/gas/output-file.c
+++ b/gas/output-file.c
@@ -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... */