summaryrefslogtreecommitdiff
path: root/gdb/bfd-target.c
diff options
context:
space:
mode:
authorPedro Alves <pedro@codesourcery.com>2009-07-28 15:22:20 +0000
committerPedro Alves <pedro@codesourcery.com>2009-07-28 15:22:20 +0000
commitf8e1eb719fd04d19f43c351886ca34784673a57a (patch)
tree973a7fdf7041d8e40761169789bafb3eb9e53dee /gdb/bfd-target.c
parentc1540aff30aa4fc7601618148ed31f0aea883f25 (diff)
downloadgdb-f8e1eb719fd04d19f43c351886ca34784673a57a.tar.gz
Revert previous commit.
Diffstat (limited to 'gdb/bfd-target.c')
-rw-r--r--gdb/bfd-target.c11
1 files changed, 1 insertions, 10 deletions
diff --git a/gdb/bfd-target.c b/gdb/bfd-target.c
index 2b7894e28e1..ffaa4ffe440 100644
--- a/gdb/bfd-target.c
+++ b/gdb/bfd-target.c
@@ -54,10 +54,7 @@ static void
target_bfd_xclose (struct target_ops *t, int quitting)
{
struct target_section_table *table = t->to_data;
-
- /* If the target sections table is empty, the bfd had already been
- closed. */
- if (table->sections != table->sections_end)
+ if (table->sections)
bfd_close (table->sections->bfd);
xfree (table->sections);
xfree (table);
@@ -73,12 +70,6 @@ target_bfd_reopen (struct bfd *bfd)
table = XZALLOC (struct target_section_table);
build_section_table (bfd, &table->sections, &table->sections_end);
- /* No use keeping the bfd open if there are no target sections we
- care about. This way, we avoid keeping the bfd pointer stored
- somewhere so that target_bfd_xclose could use it. */
- if (table->sections == table->sections_end)
- bfd_close (bfd);
-
t = XZALLOC (struct target_ops);
t->to_shortname = "bfd";
t->to_longname = _("BFD backed target");