mirror of
https://github.com/bminor/binutils-gdb.git
synced 2025-12-26 17:18:55 +00:00
* 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:
@@ -422,9 +422,9 @@ free_objfile (struct objfile *objfile)
|
||||
(*objfile->sf->sym_finish) (objfile);
|
||||
}
|
||||
|
||||
/* We always close the bfd. */
|
||||
/* We always close the bfd, unless the OBJF_KEEPBFD flag is set. */
|
||||
|
||||
if (objfile->obfd != NULL)
|
||||
if (objfile->obfd != NULL && !(objfile->flags & OBJF_KEEPBFD))
|
||||
{
|
||||
char *name = bfd_get_filename (objfile->obfd);
|
||||
if (!bfd_close (objfile->obfd))
|
||||
|
||||
Reference in New Issue
Block a user