mirror of
https://sourceware.org/git/binutils-gdb.git
synced 2024-11-27 03:51:15 +08:00
05d52ace86
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.
59 lines
2.2 KiB
C
59 lines
2.2 KiB
C
/* Data structures for RS/6000 shared libraries, for GDB.
|
|
Copyright 1991, 1992, 1994, 1997 Free Software Foundation, Inc.
|
|
|
|
This file is part of GDB.
|
|
|
|
This program is free software; you can redistribute it and/or modify
|
|
it under the terms of the GNU General Public License as published by
|
|
the Free Software Foundation; either version 2 of the License, or
|
|
(at your option) any later version.
|
|
|
|
This program is distributed in the hope that it will be useful,
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
GNU General Public License for more details.
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
along with this program; if not, write to the Free Software
|
|
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
|
|
|
|
/* The vmap struct is used to describe the virtual address space of
|
|
the target we are manipulating. The first entry is always the "exec"
|
|
file. Subsequent entries correspond to other objects that are
|
|
mapped into the address space of a process created from the "exec" file.
|
|
These are either in response to exec()ing the file, in which case all
|
|
shared libraries are loaded, or a "load" system call, followed by the
|
|
user's issuance of a "load" command. */
|
|
|
|
struct vmap {
|
|
struct vmap *nxt; /* ptr to next in chain */
|
|
bfd *bfd; /* BFD for mappable object library */
|
|
char *name; /* ptr to object file name */
|
|
char *member; /* ptr to member name */
|
|
CORE_ADDR tstart; /* virtual addr where member is mapped */
|
|
CORE_ADDR tend; /* virtual upper bound of member */
|
|
CORE_ADDR tvma; /* virtual addr of text section in object file */
|
|
CORE_ADDR toffs; /* offset of text section in object file */
|
|
CORE_ADDR dstart; /* virtual address of data start */
|
|
CORE_ADDR dend; /* virtual address of data end */
|
|
CORE_ADDR dvma; /* virtual addr of data section in object file */
|
|
|
|
/* This is NULL for the exec-file. */
|
|
struct objfile *objfile;
|
|
|
|
unsigned loaded:1; /* True if symbols are loaded */
|
|
unsigned padding:15;
|
|
};
|
|
|
|
|
|
struct vmap_and_bfd {
|
|
bfd *pbfd;
|
|
struct vmap *pvmap;
|
|
};
|
|
|
|
extern struct vmap *vmap;
|
|
|
|
/* Hook for symbol table relocation at runtime. */
|
|
|
|
extern void (*xcoff_relocate_symtab_hook) PARAMS ((unsigned int));
|