aboutsummaryrefslogtreecommitdiff
path: root/bfd
diff options
context:
space:
mode:
authorJerome Guitton <guitton@adacore.com>2004-06-17 11:47:51 +0000
committerJerome Guitton <guitton@adacore.com>2004-06-17 11:47:51 +0000
commit02d5a37b2d1262e7f7d877ba134350cadae67973 (patch)
tree205b91712ff52eb11310f26fcf9b6c67994cc935 /bfd
parentd2bef492886e2d8828c191362b683a3391107991 (diff)
downloadfsf-binutils-gdb-02d5a37b2d1262e7f7d877ba134350cadae67973.zip
fsf-binutils-gdb-02d5a37b2d1262e7f7d877ba134350cadae67973.tar.gz
fsf-binutils-gdb-02d5a37b2d1262e7f7d877ba134350cadae67973.tar.bz2
* bfd-in.h (bfd_cache_close_all): New function declaration.
* bfd-in2.h: Regenerate. * cache.c (bfd_cache_close_all): New function definition.
Diffstat (limited to 'bfd')
-rw-r--r--bfd/ChangeLog6
-rw-r--r--bfd/bfd-in.h2
-rw-r--r--bfd/bfd-in2.h2
-rw-r--r--bfd/cache.c25
4 files changed, 35 insertions, 0 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index abaaf7a..d475a27 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,3 +1,9 @@
+2004-06-17 Jerome Guitton <guitton@gnat.com>
+
+ * bfd-in.h (bfd_cache_close_all): New function declaration.
+ * bfd-in2.h: Regenerate.
+ * cache.c (bfd_cache_close_all): New function definition.
+
2004-06-16 Mark Kettenis <kettenis@gnu.org>
* configure.in: Don't set COREFILE to trad-core.lo for FreeBSD
diff --git a/bfd/bfd-in.h b/bfd/bfd-in.h
index cbf7e93..5f98164 100644
--- a/bfd/bfd-in.h
+++ b/bfd/bfd-in.h
@@ -511,6 +511,8 @@ extern bfd_boolean bfd_cache_close
(bfd *abfd);
/* NB: This declaration should match the autogenerated one in libbfd.h. */
+extern bfd_boolean bfd_cache_close_all (void);
+
extern bfd_boolean bfd_record_phdr
(bfd *, unsigned long, bfd_boolean, flagword, bfd_boolean, bfd_vma,
bfd_boolean, bfd_boolean, unsigned int, struct bfd_section **);
diff --git a/bfd/bfd-in2.h b/bfd/bfd-in2.h
index 851fe47..87dd250 100644
--- a/bfd/bfd-in2.h
+++ b/bfd/bfd-in2.h
@@ -518,6 +518,8 @@ extern bfd_boolean bfd_cache_close
(bfd *abfd);
/* NB: This declaration should match the autogenerated one in libbfd.h. */
+extern bfd_boolean bfd_cache_close_all (void);
+
extern bfd_boolean bfd_record_phdr
(bfd *, unsigned long, bfd_boolean, flagword, bfd_boolean, bfd_vma,
bfd_boolean, bfd_boolean, unsigned int, struct bfd_section **);
diff --git a/bfd/cache.c b/bfd/cache.c
index 58eda91..63d4d78 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