aboutsummaryrefslogtreecommitdiff
path: root/gdb/solib.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/solib.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/solib.c')
-rw-r--r--gdb/solib.c7
1 files changed, 1 insertions, 6 deletions
diff --git a/gdb/solib.c b/gdb/solib.c
index aad2d59..8e86769 100644
--- a/gdb/solib.c
+++ b/gdb/solib.c
@@ -361,7 +361,7 @@ solib_map_sections (void *arg)
do_cleanups (old_chain);
/* Leave bfd open, core_xfer_memory and "info files" need it. */
- so->abfd = abfd;
+ so->abfd = gdb_bfd_ref (abfd);
/* copy full path name into so_name, so that later symbol_file_add
can find it */
@@ -444,7 +444,6 @@ static void
symbol_add_stub (struct so_list *so, int flags)
{
struct section_addr_info *sap;
- int *p_refcount;
/* Have we already loaded this shared object? */
ALL_OBJFILES (so->objfile)
@@ -457,10 +456,6 @@ symbol_add_stub (struct so_list *so, int flags)
so->sections_end);
so->objfile = symbol_file_add_from_bfd (so->abfd, flags, sap, OBJF_SHARED);
- p_refcount = xmalloc (sizeof (*p_refcount));
- *p_refcount = 2; /* Both solib and objfile refer to this abfd. */
- bfd_usrdata (so->abfd) = p_refcount;
-
free_section_addr_info (sap);
return;