From 572d275cf70be4f861e0cdbf55e1136a3b57b69e Mon Sep 17 00:00:00 2001 From: Ulrich Weigand Date: Thu, 15 Jan 2009 16:35:22 +0000 Subject: * 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. --- gdb/solist.h | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'gdb/solist.h') diff --git a/gdb/solist.h b/gdb/solist.h index 9c5b36bf697..64754f34e97 100644 --- a/gdb/solist.h +++ b/gdb/solist.h @@ -103,6 +103,9 @@ struct target_so_ops the run time loader */ int (*in_dynsym_resolve_code) (CORE_ADDR pc); + /* Find and open shared library binary file. */ + bfd *(*bfd_open) (char *pathname); + /* Extra hook for finding and opening a solib. Convenience function for remote debuggers finding host libs. */ int (*find_and_open_solib) (char *soname, @@ -126,6 +129,12 @@ void free_so (struct so_list *so); /* Return address of first so_list entry in master shared object list. */ struct so_list *master_so_list (void); +/* Find shared library binary file. */ +extern char *solib_find (char *in_pathname, int *fd); + +/* Open BFD for shared library file. */ +extern bfd *solib_bfd_fopen (char *pathname, int fd); + /* Find solib binary file and open it. */ extern bfd *solib_bfd_open (char *in_pathname); -- cgit v1.2.1