* solist.h (struct target_so_ops): New member bfd_open.

(solib_find): Add prototype.
	(solib_bfd_fopen): Add prototype.
	* solib.c (solib_find, solib_bfd_fopen): New functions, extracted
	from solib_bfd_open.
	(solib_bfd_open): Use ops->bfd_open override if present.  Call
	solib_find and solib_bfd_open otherwise.

	* objfiles.h (OBJF_KEEPBFD): New define.
	* objfiles.c (free_objfile): Do not close BFD if OBJF_KEEPBFD
	objfile flag is set.
	* solib.c (symbol_add_stub): Do not allocate second BFD for
	shared library; use OBJF_KEEPBFD flag on solib objfile.
This commit is contained in:
Ulrich Weigand
2009-01-15 16:35:22 +00:00
parent 0701b27131
commit 572d275cf7
5 changed files with 108 additions and 42 deletions

View File

@@ -414,6 +414,12 @@ 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). */