From 8ee2b379b49d8132dc895ba40e80cf36044358ba Mon Sep 17 00:00:00 2001 From: Tom Tromey Date: Mon, 23 Jul 2012 14:56:07 +0000 Subject: * bfd-target.c (target_bfd_reopen): Update. * cli/cli-dump.c (bfd_openr_with_cleanup) (bfd_openw_with_cleanup): Update. * corelow.c (core_open): Update. * dsrec.c (load_srec): Update. * exec.c (exec_file_attach): Update. * gcore.c (create_gcore_bfd): Update. * gdb_bfd.c (gdb_bfd_ref): Return void. (gdb_bfd_open): Update. * gdb_bfd.h (gdb_bfd_ref): Return void. Update comments. * jit.c (jit_bfd_try_read_symtab): Update. * m32r-rom.c (m32r_load, m32r_upload_command): Update. * machoread.c (macho_symfile_read_all_oso): Update. (macho_check_dsym): Update. * procfs.c (insert_dbx_link_bpt_in_file): Update. * remote-m32r-sdi.c (m32r_load): Update. * remote-mips.c (mips_load_srec, pmon_load_fast): Update. * rs6000-nat.c (add_vmap): Update. * solib-darwin.c (darwin_solib_get_all_image_info_addr_at_init): Update. * solib-pa64.c (pa64_solib_create_inferior_hook): Update. * solib-spu.c (spu_bfd_open): Update. * solib.c (solib_bfd_fopen, solib_read_symbols): Update. * spu-linux-nat.c (spu_bfd_open): Update. * symfile.c (bfd_open_maybe_remote, symfile_bfd_open) (generic_load): Update. * windows-nat.c (windows_make_so): Update. --- gdb/gdb_bfd.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'gdb/gdb_bfd.c') diff --git a/gdb/gdb_bfd.c b/gdb/gdb_bfd.c index 10489ace8f2..dd6eac38a52 100644 --- a/gdb/gdb_bfd.c +++ b/gdb/gdb_bfd.c @@ -158,7 +158,8 @@ gdb_bfd_open (const char *name, const char *target, int fd) if (abfd != NULL) { close (fd); - return gdb_bfd_ref (abfd); + gdb_bfd_ref (abfd); + return abfd; } abfd = bfd_fopen (name, target, FOPEN_RB, fd); @@ -170,7 +171,8 @@ gdb_bfd_open (const char *name, const char *target, int fd) *slot = abfd; gdb_bfd_stash_filename (abfd); - return gdb_bfd_ref (abfd); + gdb_bfd_ref (abfd); + return abfd; } /* A helper function that releases any section data attached to the @@ -218,28 +220,26 @@ gdb_bfd_close_or_warn (struct bfd *abfd) /* Add reference to ABFD. Returns ABFD. */ -struct bfd * +void gdb_bfd_ref (struct bfd *abfd) { struct gdb_bfd_data *gdata; if (abfd == NULL) - return NULL; + return; gdata = bfd_usrdata (abfd); if (gdata != NULL) { gdata->refc += 1; - return abfd; + return; } gdata = bfd_zalloc (abfd, sizeof (struct gdb_bfd_data)); gdata->refc = 1; gdata->mtime = bfd_get_mtime (abfd); bfd_usrdata (abfd) = gdata; - - return abfd; } /* Unreference and possibly close ABFD. */ -- cgit v1.2.1