* objfiles.c (gdb_bfd_unref): Use the bfd_usrdata accessor.
* solib.c (symbol_add_stub): Likewise.
* symfile.c (symfile_bfd_open): Assert BFD_USRDATA is NULL.
+2009-08-10 Jan Kratochvil <jan.kratochvil@redhat.com>
+
+ * objfiles.c (gdb_bfd_unref): Use the bfd_usrdata accessor.
+ * solib.c (symbol_add_stub): Likewise.
+ * symfile.c (symfile_bfd_open): Assert BFD_USRDATA is NULL.
+
2009-08-10 Paul Pluzhnikov <ppluzhnikov@google.com>
* objfiles.c (qsort_cmp): Remove assert.
if (abfd == NULL)
return;
- p_refcount = abfd->usrdata;
+ p_refcount = bfd_usrdata (abfd);
/* Valid range for p_refcount: NULL (single owner), or a pointer
to int counter, which has a value of 1 (single owner) or 2 (shared). */
return;
}
xfree (p_refcount);
- abfd->usrdata = NULL; /* Paranoia. */
+ bfd_usrdata (abfd) = NULL; /* Paranoia. */
name = bfd_get_filename (abfd);
if (!bfd_close (abfd))
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. */
- so->abfd->usrdata = p_refcount;
+ bfd_usrdata (so->abfd) = p_refcount;
free_section_addr_info (sap);
bfd_errmsg (bfd_get_error ()));
}
+ /* bfd_usrdata exists for applications and libbfd must not touch it. */
+ gdb_assert (bfd_usrdata (sym_bfd) == NULL);
+
return sym_bfd;
}