+
+int
+kernel_u_size (void)
+{
+ return (sizeof (struct user));
+}
+\f
+/* Under AIX, we have to pass the correct TOC pointer to a function
+ when calling functions in the inferior.
+ We try to find the relative toc offset of the objfile containing PC
+ and add the current load address of the data segment from the vmap. */
+
+static CORE_ADDR
+find_toc_address (CORE_ADDR pc)
+{
+ struct vmap *vp;
+ extern CORE_ADDR get_toc_offset (struct objfile *); /* xcoffread.c */
+
+ for (vp = vmap; vp; vp = vp->nxt)
+ {
+ if (pc >= vp->tstart && pc < vp->tend)
+ {
+ /* vp->objfile is only NULL for the exec file. */
+ return vp->dstart + get_toc_offset (vp->objfile == NULL
+ ? symfile_objfile
+ : vp->objfile);
+ }
+ }
+ error ("Unable to find TOC entry for pc 0x%x\n", pc);
+}
+\f
+/* Register that we are able to handle rs6000 core file formats. */
+
+static struct core_fns rs6000_core_fns =
+{
+ bfd_target_xcoff_flavour, /* core_flavour */
+ default_check_format, /* check_format */
+ default_core_sniffer, /* core_sniffer */
+ fetch_core_registers, /* core_read_registers */
+ NULL /* next */
+};
+
+void
+_initialize_core_rs6000 (void)
+{
+ /* Initialize hook in rs6000-tdep.c for determining the TOC address when
+ calling functions in the inferior. */
+ rs6000_find_toc_address_hook = find_toc_address;
+
+ /* Initialize hook in rs6000-tdep.c to set the current architecture when
+ starting a child process. */
+ rs6000_set_host_arch_hook = set_host_arch;
+
+ /* For native configurations, where this module is included, inform
+ the xcoffsolib module where it can find the function for symbol table
+ relocation at runtime. */
+ xcoff_relocate_symtab_hook = xcoff_relocate_symtab;
+ add_core_fns (&rs6000_core_fns);
+}