aboutsummaryrefslogtreecommitdiff
path: root/binutils/nm.c
diff options
context:
space:
mode:
authorIan Lance Taylor <ian@airs.com>1994-03-29 20:00:09 +0000
committerIan Lance Taylor <ian@airs.com>1994-03-29 20:00:09 +0000
commit9f191108c13b407b2996beedc28d61f58310e862 (patch)
treecc5cd160a3bce02bbef7a12f00d8c0d87c017136 /binutils/nm.c
parenta87c93b7166a62849b57bbfa35beda45c98edef4 (diff)
downloadgdb-9f191108c13b407b2996beedc28d61f58310e862.zip
gdb-9f191108c13b407b2996beedc28d61f58310e862.tar.gz
gdb-9f191108c13b407b2996beedc28d61f58310e862.tar.bz2
* nm.c (display_archive): Close each archive element after it has
been displayed.
Diffstat (limited to 'binutils/nm.c')
-rw-r--r--binutils/nm.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/binutils/nm.c b/binutils/nm.c
index 6580e7b..8aca314 100644
--- a/binutils/nm.c
+++ b/binutils/nm.c
@@ -271,6 +271,7 @@ main (argc, argv)
int retval;
program_name = *argv;
+ xmalloc_set_program_name (program_name);
bfd_init ();
@@ -381,7 +382,7 @@ display_archive (file)
if (arfile == NULL)
{
- if (bfd_error != no_more_archived_files)
+ if (bfd_get_error () != bfd_error_no_more_archived_files)
bfd_fatal (bfd_get_filename (file));
break;
}
@@ -395,12 +396,14 @@ display_archive (file)
else
{
bfd_nonfatal (bfd_get_filename (arfile));
- if (bfd_error == file_ambiguously_recognized)
+ if (bfd_get_error () == bfd_error_file_ambiguously_recognized)
{
list_matching_formats (matching);
free (matching);
}
}
+
+ bfd_close (arfile);
}
}
@@ -431,7 +434,7 @@ display_file (filename)
else
{
bfd_nonfatal (filename);
- if (bfd_error == file_ambiguously_recognized)
+ if (bfd_get_error () == bfd_error_file_ambiguously_recognized)
{
list_matching_formats (matching);
free (matching);