aboutsummaryrefslogtreecommitdiff
path: root/bfd/elf.c
diff options
context:
space:
mode:
authorIan Lance Taylor <ian@airs.com>1998-01-28 18:42:54 +0000
committerIan Lance Taylor <ian@airs.com>1998-01-28 18:42:54 +0000
commite6e3d4bdf4c9d28848bb19e51d4a949a8b12087c (patch)
treef359d9bb5a5323ab22c3ba5b8195cbac259472d6 /bfd/elf.c
parent0f1ec0f95fef8a5dd72292b260251282645a1ad9 (diff)
downloadgdb-e6e3d4bdf4c9d28848bb19e51d4a949a8b12087c.zip
gdb-e6e3d4bdf4c9d28848bb19e51d4a949a8b12087c.tar.gz
gdb-e6e3d4bdf4c9d28848bb19e51d4a949a8b12087c.tar.bz2
* elf.c (_bfd_elf_close_and_cleanup): Only check the strtab if we
have a bfd_object.
Diffstat (limited to 'bfd/elf.c')
-rw-r--r--bfd/elf.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/bfd/elf.c b/bfd/elf.c
index fa83495..71d13f7 100644
--- a/bfd/elf.c
+++ b/bfd/elf.c
@@ -4236,7 +4236,11 @@ boolean
_bfd_elf_close_and_cleanup (abfd)
bfd *abfd;
{
- if (elf_shstrtab (abfd))
- _bfd_stringtab_free (elf_shstrtab (abfd));
+ if (bfd_get_format (abfd) == bfd_object)
+ {
+ if (elf_shstrtab (abfd) != NULL)
+ _bfd_stringtab_free (elf_shstrtab (abfd));
+ }
+
return _bfd_generic_close_and_cleanup (abfd);
}