aboutsummaryrefslogtreecommitdiff
path: root/binutils/size.c
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2002-05-04 01:31:50 +0000
committerAlan Modra <amodra@gmail.com>2002-05-04 01:31:50 +0000
commit6b52b824688a08534d1ae924ea89d722df2ae079 (patch)
tree4617c515096303d69132e9c0da5672c9d714e036 /binutils/size.c
parent301e31397f55349bbe90e4948c60f8361cb9ec44 (diff)
downloadgdb-6b52b824688a08534d1ae924ea89d722df2ae079.zip
gdb-6b52b824688a08534d1ae924ea89d722df2ae079.tar.gz
gdb-6b52b824688a08534d1ae924ea89d722df2ae079.tar.bz2
* size.c (display_archive): Add last_arfile and code to close archives.
Diffstat (limited to 'binutils/size.c')
-rw-r--r--binutils/size.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/binutils/size.c b/binutils/size.c
index 3da7520..961593b 100644
--- a/binutils/size.c
+++ b/binutils/size.c
@@ -316,6 +316,7 @@ display_archive (file)
bfd *file;
{
bfd *arfile = (bfd *) NULL;
+ bfd *last_arfile = (bfd *) NULL;
for (;;)
{
@@ -333,8 +334,14 @@ display_archive (file)
}
display_bfd (arfile);
- /* Don't close the archive elements; we need them for next_archive. */
+
+ if (last_arfile != NULL)
+ bfd_close (last_arfile);
+ last_arfile = arfile;
}
+
+ if (last_arfile != NULL)
+ bfd_close (last_arfile);
}
static void