]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
Call bfd_close_all_done in output_file_close
authorAlan Modra <amodra@gmail.com>
Fri, 27 Jan 2023 02:01:27 +0000 (12:31 +1030)
committerAlan Modra <amodra@gmail.com>
Fri, 27 Jan 2023 05:16:20 +0000 (15:46 +1030)
bfd_cache_close_all is good for closing file descriptors, but doesn't
do the cleanup of bfd memory as in bfd_close_all_done.

PR 13056
* output-file.c (output_file_close): Call bfd_close_all_done,
not bfd_cache_close_all.

gas/output-file.c

index 4c97e8f1a9bea942abaccb03aa3cbaef638548a0..88f4011651395f3b82b6c048bdb23a5fb9badf66 100644 (file)
@@ -96,7 +96,7 @@ output_file_close (void)
 
   /* Close the bfd.  */
   if (!flag_always_generate_output && had_errors ())
-    res = bfd_cache_close_all ();
+    res = bfd_close_all_done (obfd);
   else
     res = bfd_close (obfd);
   now_seg = NULL;