diff options
author | Ulrich Weigand <uweigand@de.ibm.com> | 2009-01-15 16:35:22 +0000 |
---|---|---|
committer | Ulrich Weigand <uweigand@de.ibm.com> | 2009-01-15 16:35:22 +0000 |
commit | 572d275cf70be4f861e0cdbf55e1136a3b57b69e (patch) | |
tree | 719a0f2ee00b194f7444f4b35399c87f9776fdbd /gdb/objfiles.c | |
parent | 0701b271317da6be2e9913db907285c2ebc39711 (diff) | |
download | gdb-572d275cf70be4f861e0cdbf55e1136a3b57b69e.zip gdb-572d275cf70be4f861e0cdbf55e1136a3b57b69e.tar.gz gdb-572d275cf70be4f861e0cdbf55e1136a3b57b69e.tar.bz2 |
* 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.
Diffstat (limited to 'gdb/objfiles.c')
-rw-r--r-- | gdb/objfiles.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/gdb/objfiles.c b/gdb/objfiles.c index c7a8564..bc77de8 100644 --- a/gdb/objfiles.c +++ b/gdb/objfiles.c @@ -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)) |