Update gdb.ada/variant_record_packed_array
[deliverable/binutils-gdb.git] / gdb / bfd-target.c
index cfeb0b12f652d3ae8aee15751081f01a814fcaae..455d3e694ccac524423a19dde9a5a4b5f516eda0 100644 (file)
@@ -1,7 +1,6 @@
 /* Very simple "bfd" target, for GDB, the GNU debugger.
 
-   Copyright (C) 2003, 2005, 2007, 2008, 2009, 2010, 2011
-   Free Software Foundation, Inc.
+   Copyright (C) 2003, 2005, 2007-2012 Free Software Foundation, Inc.
 
    This file is part of GDB.
 
@@ -22,6 +21,7 @@
 #include "target.h"
 #include "bfd-target.h"
 #include "exec.h"
+#include "gdb_bfd.h"
 
 /* The object that is stored in the target_ops->to_data field has this
    type.  */
@@ -71,21 +71,22 @@ target_bfd_xclose (struct target_ops *t, int quitting)
 {
   struct target_bfd_data *data = t->to_data;
 
-  bfd_close (data->bfd);
+  gdb_bfd_unref (data->bfd);
   xfree (data->table.sections);
   xfree (data);
   xfree (t);
 }
 
 struct target_ops *
-target_bfd_reopen (struct bfd *bfd)
+target_bfd_reopen (struct bfd *abfd)
 {
   struct target_ops *t;
   struct target_bfd_data *data;
 
   data = XZALLOC (struct target_bfd_data);
-  data->bfd = bfd;
-  build_section_table (bfd, &data->table.sections, &data->table.sections_end);
+  data->bfd = abfd;
+  gdb_bfd_ref (abfd);
+  build_section_table (abfd, &data->table.sections, &data->table.sections_end);
 
   t = XZALLOC (struct target_ops);
   t->to_shortname = "bfd";
This page took 0.02512 seconds and 4 git commands to generate.