diff --git a/gdb/target.c b/gdb/target.c index 86cdb71..3c37ee4 100644 --- a/gdb/target.c +++ b/gdb/target.c @@ -1934,6 +1934,12 @@ void target_mourn_inferior (void) { struct target_ops *t; + + /* We no longer need to keep handles on any of the object files. + Make sure to release them to avoid unnecessarily locking any + of them while we're not actually debugging. */ + bfd_cache_close_all (); + for (t = current_target.beneath; t != NULL; t = t->beneath) { if (t->to_mourn_inferior != NULL)