summaryrefslogtreecommitdiff
path: root/bfd/cache.c
diff options
context:
space:
mode:
Diffstat (limited to 'bfd/cache.c')
-rw-r--r--bfd/cache.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/bfd/cache.c b/bfd/cache.c
index 58eda916bb..63d4d786ae 100644
--- a/bfd/cache.c
+++ b/bfd/cache.c
@@ -344,6 +344,31 @@ bfd_cache_close (bfd *abfd)
}
/*
+FUNCTION
+ bfd_cache_close_all
+
+SYNOPSIS
+ bfd_boolean bfd_cache_close_all (void);
+
+DESCRIPTION
+ Remove all BFDs from the cache. If the attached file is open,
+ then close it too.
+
+RETURNS
+ <<FALSE>> is returned if closing one of the file fails, <<TRUE>> is
+ returned if all is well.
+*/
+
+bfd_boolean
+bfd_cache_close_all ()
+{
+ bfd_boolean ret = TRUE;
+
+ while (bfd_last_cache != NULL)
+ ret &= bfd_cache_close (bfd_last_cache);
+}
+
+/*
INTERNAL_FUNCTION
bfd_open_file