From 8ac244b433d5d36b787afd36f7144069e7d837e0 Mon Sep 17 00:00:00 2001 From: Tom Tromey Date: Mon, 23 Jul 2012 14:58:44 +0000 Subject: * coffread.c (coff_symfile_read): Make a cleanup for 'debugfile' and 'abfd'. * elfread.c (elf_symfile_read): Make a cleanup for 'debugfile' and 'abfd'. * jit.c (jit_bfd_try_read_symtab): Make a cleanup for 'nbfd'. * machoread.c (macho_add_oso_symfile): Make a cleanup for 'abfd'. (macho_symfile_read): Make a cleanup for 'dsym_bfd'. * objfiles.c (allocate_objfile): Acquire a new reference. * rs6000-nat.c (add_vmap): Don't acquire a BFD reference. * solib.c (solib_read_symbols): Don't acquire a BFD reference. * spu-linux-nat.c (spu_symbol_file_add_from_memory): Make a cleanup for 'nbfd'. * symfile-mem.c (symbol_file_add_from_memory): Make a cleanup for 'nbfd'. * symfile.c (symbol_file_add_with_addrs_or_offsets): Don't make a cleanup for 'abfd'. (symbol_file_add): Make a BFD cleanup. --- gdb/objfiles.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'gdb/objfiles.c') diff --git a/gdb/objfiles.c b/gdb/objfiles.c index 5ff0eb2..411618f 100644 --- a/gdb/objfiles.c +++ b/gdb/objfiles.c @@ -194,9 +194,10 @@ allocate_objfile (bfd *abfd, int flags) /* Update the per-objfile information that comes from the bfd, ensuring that any data that is reference is saved in the per-objfile data - region. Note that we steal a reference to ABFD. */ + region. */ objfile->obfd = abfd; + gdb_bfd_ref (abfd); if (abfd != NULL) { /* Look up the gdbarch associated with the BFD. */ -- cgit v1.1