Revert previous commit.
[deliverable/binutils-gdb.git] / gdb / bfd-target.c
index 2b7894e28e19db96488fe4aa8356102ab44a1de8..ffaa4ffe440c34f0d417af32d0255cca9c8f51ac 100644 (file)
@@ -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");
This page took 0.023006 seconds and 4 git commands to generate.