From 062cb0d30dd7402562c621ce9c3b6e630445b33c Mon Sep 17 00:00:00 2001 From: Fred Fish Date: Thu, 2 May 1996 01:32:41 +0000 Subject: * Makefile.in (rs6000-nat.o): Dependant on xcoffsolib.h. * config/rs6000/rs6000.mh (NATDEPFILES): Move xcoffread.o ... * config/rs6000/rs6000.mt (TDEPFILES): ... to here * xcoffsolib.c (xcoff_relocate_symtab_hook): Define and initialize. (solib_info): Call xcoff_relocate_symtab via the hook. (sharedlibrary_command): Ditto. * xcoffread.c: Remove all FAKING_RS6000 comments and defines. (xcoff_add_toc_to_loadinfo_hook): Define and initialize here. (xcoff_init_loadinfo_hook): Define and initialize here. (scan_xcoff_symtab): Call xcoff_add_toc_to_loadinfo via the hook. (xcoff_initial_scan): Call xcoff_init_loadinfo via the hook. * xcoffsolib.h (xcoff_relocate_symtab_hook): Declare extern func. * rs6000-tdep.c (_initialize_rs6000_tdep): Add initializations of xcoff_add_toc_to_loadinfo_hook and xcoff_init_loadinfo_hook. * rs6000-nat.c (_initialize_core_rs6000): Add initialization of xcoff_relocate_symtab_hook. --- gdb/xcoffsolib.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'gdb/xcoffsolib.c') diff --git a/gdb/xcoffsolib.c b/gdb/xcoffsolib.c index edcfda11a4d..45ed2b36da1 100644 --- a/gdb/xcoffsolib.c +++ b/gdb/xcoffsolib.c @@ -28,6 +28,12 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "xcoffsolib.h" #include "inferior.h" +/* Hook to relocate symbols at runtime. If gdb is build natively, this + hook is initialized in by rs6000-nat.c. If not, it is currently left + NULL and never called. */ + +void (*xcoff_relocate_symtab_hook) PARAMS ((unsigned int)) = NULL; + #ifdef SOLIB_SYMBOLS_MANUAL extern struct symtab *current_source_symtab; @@ -159,7 +165,8 @@ solib_info (args, from_tty) struct vmap *vp = vmap; /* Check for new shared libraries loaded with load (). */ - xcoff_relocate_symtab (inferior_pid); + if (xcoff_relocate_symtab_hook != NULL) + (*xcoff_relocate_symtab_hook) (inferior_pid); if (vp == NULL || vp->nxt == NULL) { @@ -194,7 +201,8 @@ sharedlibrary_command (args, from_tty) dont_repeat (); /* Check for new shared libraries loaded with load (). */ - xcoff_relocate_symtab (inferior_pid); + if (xcoff_relocate_symtab_hook != NULL) + (*xcoff_relocate_symtab_hook) (inferior_pid); #ifdef SOLIB_SYMBOLS_MANUAL solib_add (args, from_tty, (struct target_ops *)0); -- cgit v1.2.1