aboutsummaryrefslogtreecommitdiff
path: root/gdb/symfile.c
diff options
context:
space:
mode:
authorPaul Pluzhnikov <ppluzhnikov@google.com>2009-08-21 17:57:17 +0000
committerPaul Pluzhnikov <ppluzhnikov@google.com>2009-08-21 17:57:17 +0000
commit3db741efb7056cc5720fce6303962042d2da3ec9 (patch)
treee6bb583aaa7842e4305528e3a8d1571e4e48f84e /gdb/symfile.c
parent032b94c5fd9c2734a401798341eece75159ad0fb (diff)
downloadgdb-3db741efb7056cc5720fce6303962042d2da3ec9.zip
gdb-3db741efb7056cc5720fce6303962042d2da3ec9.tar.gz
gdb-3db741efb7056cc5720fce6303962042d2da3ec9.tar.bz2
2009-08-21 Paul Pluzhnikov <ppluzhnikov@google.com>
* objfiles.h (gdb_bfd_ref): New prototype. * objfiles.c (gdb_bfd_ref): New function. (allocate_objfile): Call it. (gdb_bfd_unref): Adjust assertion. * solib.c (solib_map_sections): Add reference. (symbol_add_stub): Don't add reference here. * symfile.c (reread_symbols): Add reference.
Diffstat (limited to 'gdb/symfile.c')
-rw-r--r--gdb/symfile.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/gdb/symfile.c b/gdb/symfile.c
index 5151966..5a50a09 100644
--- a/gdb/symfile.c
+++ b/gdb/symfile.c
@@ -2333,6 +2333,8 @@ reread_symbols (void)
objfile->obfd = bfd_openr (obfd_filename, gnutarget);
if (objfile->obfd == NULL)
error (_("Can't open %s to read symbols."), objfile->name);
+ else
+ objfile->obfd = gdb_bfd_ref (objfile->obfd);
/* bfd_openr sets cacheable to true, which is what we want. */
if (!bfd_check_format (objfile->obfd, bfd_object))
error (_("Can't read symbols from %s: %s."), objfile->name,