From 6b52b824688a08534d1ae924ea89d722df2ae079 Mon Sep 17 00:00:00 2001 From: Alan Modra Date: Sat, 4 May 2002 01:31:50 +0000 Subject: [PATCH] * size.c (display_archive): Add last_arfile and code to close archives. --- binutils/ChangeLog | 4 ++++ binutils/size.c | 9 ++++++++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/binutils/ChangeLog b/binutils/ChangeLog index d303d49f32c..dd922202e53 100644 --- a/binutils/ChangeLog +++ b/binutils/ChangeLog @@ -1,3 +1,7 @@ +2002-05-04 Bob Byrnes + + * size.c (display_archive): Add last_arfile and code to close archives. + 2002-05-01 Alan Modra * nm.c (print_symbol): Check returned filename from diff --git a/binutils/size.c b/binutils/size.c index 3da75207b44..961593b33e8 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 -- 2.30.2