XCOFF: use bfd_coff_close_and_cleanup
authorAlan Modra <amodra@gmail.com>
Tue, 21 Mar 2023 22:25:19 +0000 (08:55 +1030)
committerAlan Modra <amodra@gmail.com>
Tue, 21 Mar 2023 22:25:19 +0000 (08:55 +1030)
Free memory on closing bfds.  The COFF close_and_cleanup does more
work than _bfd_generic_close_and_cleanup (defined as
_bfd_archive_close_and_cleanup).

* coff-rs6000.c (_bfd_xcoff_close_and_cleanup): Define as
_bfd_coff_close_and_cleanup.
* coff64-rs6000.c (rs6000_xcoff64_vec, rs6000_xcoff64_aix_vec): Use
_bfd_coff_close_and_cleanup.

bfd/coff-rs6000.c
bfd/coff64-rs6000.c

index 735d434951eddf0f291b1affb691fa73e44b4be2..ea8c828765219eae236bff5625b4b5d8a7b305a7 100644 (file)
@@ -4368,7 +4368,7 @@ const struct xcoff_dwsect_name xcoff_dwsect_names[] = {
 };
 
 /* For generic entry points.  */
-#define _bfd_xcoff_close_and_cleanup _bfd_archive_close_and_cleanup
+#define _bfd_xcoff_close_and_cleanup _bfd_coff_close_and_cleanup
 #define _bfd_xcoff_bfd_free_cached_info _bfd_bool_bfd_true
 #define _bfd_xcoff_new_section_hook coff_new_section_hook
 #define _bfd_xcoff_get_section_contents _bfd_generic_get_section_contents
index 929a773f52ed7adc573fdd7ed310ab87cfaac27a..e3a5da374186bc28f895423bbcd732e8f9f09edb 100644 (file)
@@ -2624,7 +2624,7 @@ const bfd_target rs6000_xcoff64_vec =
     },
 
     /* Generic */
-    _bfd_archive_close_and_cleanup,
+    _bfd_coff_close_and_cleanup,
     _bfd_bool_bfd_true,
     coff_new_section_hook,
     _bfd_generic_get_section_contents,
@@ -2897,7 +2897,7 @@ const bfd_target rs6000_xcoff64_aix_vec =
     },
 
     /* Generic */
-    _bfd_archive_close_and_cleanup,
+    _bfd_coff_close_and_cleanup,
     _bfd_bool_bfd_true,
     coff_new_section_hook,
     _bfd_generic_get_section_contents,