aboutsummaryrefslogtreecommitdiff
path: root/gdb/xcoffread.c
diff options
context:
space:
mode:
authorPeter Schauer <Peter.Schauer@mytum.de>1997-08-15 21:10:32 +0000
committerPeter Schauer <Peter.Schauer@mytum.de>1997-08-15 21:10:32 +0000
commit05d52ace86cc898264acb8f23a97e22cb199ed36 (patch)
treee0051a3c2ad0d9ef0f486531f446b7b58a56774a /gdb/xcoffread.c
parentbe3d1b6f9e44f02435baac46febfe810a724b6d9 (diff)
downloadgdb-05d52ace86cc898264acb8f23a97e22cb199ed36.zip
gdb-05d52ace86cc898264acb8f23a97e22cb199ed36.tar.gz
gdb-05d52ace86cc898264acb8f23a97e22cb199ed36.tar.bz2
* infrun.c (wait_for_inferior): Add the symbols for any
newly loaded objects upon a TARGET_WAITKIND_LOADED event. Rewrite code which determines the TOC address for calling functions in the inferior under AIX. * rs6000-nat.c (find_toc_address): New function to determine the required TOC address from a function address. (_initialize_core_rs6000): Set up find_toc_address_hook to point to find_toc_address. (xcoff_relocate_symtab, xcoff_relocate_core): Remove add_text_to_loadinfo calls. (exec_one_dummy_insn): Change pid and status to int to get rid of compiler warnings. (xcoff_relocate_symtab): Cast ldi to `int *' when passing it to ptrace to get rid of compiler warnings. * rs6000-tdep.c: Add definition for find_toc_address_hook. (rs6000_fix_call_dummy): If find_toc_address_hook is non zero, patch TOC address load code in the call dummy with the value returned from find_toc_address_hook. (struct loadinfo, loadinfo, loadinfolen, loadinfotextindex, xcoff_init_loadinfo, free_loadinfo, xcoff_add_toc_to_loadinfo, add_text_to_loadinfo, find_toc_address): Remove. (_initialize_rs6000_tdep): Remove initialization of coff_add_toc_to_loadinfo_hook and xcoff_init_loadinfo_hook. * xcoffread.c (coff_add_toc_to_loadinfo_hook, xcoff_init_loadinfo_hook): Remove. (struct coff_symfile_info): Add toc_offset field. (scan_xcoff_symtab): Record toc_offset value in toc_offset field instead of calling xcoff_add_toc_to_loadinfo_hook. (get_toc_offset): New function to return the value of the toc_offset field for an object file. (xcoff_initial_scan): Remove call of xcoff_init_loadinfo_hook. * xcoffsolib.h (add_text_to_loadinfo): Remove declaration. * config/rs6000/tm-rs6000.h: Add declarations for find_toc_address_hook and get_toc_offset.
Diffstat (limited to 'gdb/xcoffread.c')
-rw-r--r--gdb/xcoffread.c34
1 files changed, 16 insertions, 18 deletions
diff --git a/gdb/xcoffread.c b/gdb/xcoffread.c
index 9200147..956f576 100644
--- a/gdb/xcoffread.c
+++ b/gdb/xcoffread.c
@@ -88,17 +88,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
/* This is output from LD. */
#define N_SETV 0x1C /* Pointer to set vector in data area. */
-
-/* Hook for recording the toc offset value of a symbol table into
- the ldinfo structure. */
-
-void (*xcoff_add_toc_to_loadinfo_hook) PARAMS ((unsigned long)) = NULL;
-
-/* Hook for recording how to call xcoff_init_loadinfo for a native
- rs6000 config only. */
-
-void (*xcoff_init_loadinfo_hook) PARAMS ((void)) = NULL;
-
/* We put a pointer to this structure in the read_symtab_private field
of the psymtab. */
@@ -185,6 +174,9 @@ struct coff_symfile_info {
/* Number of symbols in symtbl. */
int symtbl_num_syms;
+
+ /* Offset in data section to TOC anchor. */
+ CORE_ADDR toc_offset;
};
static struct complaint storclass_complaint =
@@ -2628,12 +2620,22 @@ scan_xcoff_symtab (section_offsets, objfile)
dependencies_used, textlow_not_set);
}
- /* Record the toc offset value of this symbol table into ldinfo structure.
+ /* Record the toc offset value of this symbol table into objfile structure.
If no XMC_TC0 is found, toc_offset should be zero. Another place to obtain
this information would be file auxiliary header. */
- if (xcoff_add_toc_to_loadinfo_hook != NULL)
- (*xcoff_add_toc_to_loadinfo_hook) ((unsigned long) toc_offset);
+ ((struct coff_symfile_info *) objfile->sym_private)->toc_offset = toc_offset;
+}
+
+/* Return the toc offset value for a given objfile. */
+
+CORE_ADDR
+get_toc_offset (objfile)
+ struct objfile *objfile;
+{
+ if (objfile)
+ return ((struct coff_symfile_info *) objfile->sym_private)->toc_offset;
+ return 0;
}
/* Scan and build partial symbols for a symbol file.
@@ -2662,10 +2664,6 @@ xcoff_initial_scan (objfile, section_offsets, mainline)
char *name;
unsigned int size;
- /* Initialize load info structure. */
- if (mainline && xcoff_init_loadinfo_hook != NULL)
- (*xcoff_init_loadinfo_hook) ();
-
info = (struct coff_symfile_info *) objfile -> sym_private;
symfile_bfd = abfd = objfile->obfd;
name = objfile->name;