> No, we should already be calling _bfd_archive_close_and_cleanup via > > > --- a/bfd/opncls.c > > +++ b/bfd/opncls.c > > @@ -719,6 +719,17 @@ bfd_close (bfd *abfd) > > if (! BFD_SEND (abfd, _close_and_cleanup, (abfd))) > > this call. The problem is in coff-rs6000.c (and coff64-rs6000.c) > where the bfd_target vector just uses bfd_true for close_and_cleanup. Attached is a patch that implements your suggestion. Tested on ppc-aix using AdaCore's GDB testsuite. While at it, the powermac XCOFF backend also seemed to be using the same code that eventually leads to the dangling pointer, and so I fixed it as well. It's untested, but seems straightforward enough. OK to commit? Thanks, -- Joel