2009-08-04 Paul Pluzhnikov <ppluzhnikov@google.com>

* objfiles.h (OBJF_KEEPBFD): Delete.
	(gdb_bfd_unref): New prototype.
	* objfiles.c (gdb_bfd_unref): New function.
	(free_objfile): Call gdb_bfd_unref.
	* solib.c (free_so): Likewise.
	(symbol_add_stub): Set refcount.
This commit is contained in:
Paul Pluzhnikov
2009-08-04 18:46:05 +00:00
parent afd0cd3fc1
commit e3c69974ac
4 changed files with 51 additions and 29 deletions

View File

@ -414,12 +414,6 @@ struct objfile
#define OBJF_USERLOADED (1 << 3) /* User loaded */
/* The bfd of this objfile is used outside of the objfile (e.g. by solib).
Do not try to free it. */
#define OBJF_KEEPBFD (1 << 4) /* Do not delete bfd */
/* The object file that the main symbol table was loaded from (e.g. the
argument to the "symbol-file" or "file" command). */
@ -510,6 +504,8 @@ extern void set_objfile_data (struct objfile *objfile,
const struct objfile_data *data, void *value);
extern void *objfile_data (struct objfile *objfile,
const struct objfile_data *data);
extern void gdb_bfd_unref (struct bfd *abfd);
/* Traverse all object files. ALL_OBJFILES_SAFE works even if you delete