/* Very simple "bfd" target, for GDB, the GNU debugger.
- Copyright (C) 2003, 2005, 2007-2012 Free Software Foundation, Inc.
+ Copyright (C) 2003-2013 Free Software Foundation, Inc.
This file is part of GDB.
#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. */
}
static void
-target_bfd_xclose (struct target_ops *t, int quitting)
+target_bfd_xclose (struct target_ops *t)
{
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);
data = XZALLOC (struct target_bfd_data);
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_xfer_partial = target_bfd_xfer_partial;
t->to_xclose = target_bfd_xclose;
t->to_data = data;
+ t->to_magic = OPS_MAGIC;
return t;
}