SOLIB_SYMBOLS_MANUAL code, cleanup of AIX shared library handling code.
* rs6000-nat.c (vmap_symtab): Do not try to modify offsets
if symbols are not yet loaded.
(vmap_add_symbols): New function to add symbols for a vmap entry.
(add_vmap): Turn errors into warnings, return NULL vmap upon
failure. Add symbols via vmap_add_symbols only if requested.
(xcoff_relocate_core): Allow debugging of core files without an
executable file. Handle NULL returns from add_vmap gracefully.
* xcoffsolib.c (solib_add): Remove, no longer needed.
(solib_info): Do not check for new shared libraries if there is no
inferior process.
(sharedlibrary_command): Made static.
Do not check for new shared libraries if there is no inferior process.
Add symbols for requested shared libraries via vmap_add_symbols.
(_initialize_solib): Add `set auto-solib-add' command.
* xcoffsolib.h (vmap_add_symbols): Add prototype declaration.
* config/rs6000/tm-rs6000.h (PC_LOAD_SEGMENT): Move from here ...
* config/rs6000/nm-rs6000.h: ... to here, this is an AIX native
feature.
* config/powerpc/tm-macos.h, config/powerpc/tm-ppc-eabi.h,
config/powerpc/tm-ppc-nw.h, config/rs6000/tm-rs6000ly.h:
Remove #undef PC_LOAD_SEGMENT.
* config/powerpc/aix.mt, config/rs6000/aix4.mt, config/rs6000/rs6000.mt
(TDEPFILES): Move xcoffsolib.o from here ...
* config/powerpc/aix.mh, config/rs6000/aix4.mh, config/rs6000/rs6000.mh
(NATDEPFILES): ... to here, xcoffsolib.o contains AIX native code
only.
* rs6000-tdep.c: Remove #include xcoffsolib.h, no longer needed.
* xcoffsolib.h (xcoff_relocate_symtab_hook): Remove declaration.
* rs6000-nat.c (_initialize_core_rs6000): Remove setting of
xcoff_relocate_symtab_hook, no longer needed.
* xcoffsolib.c (solib_info, sharedlibrary_command): Remove
xcoff_relocate_symtab_hook indirection, call xcoff_relocate_symtab
directly, as xcoffsolib.c is now compiled in native AIX configurations
only.
* Makefile.in: Update dependencies for rs6000-tdep.o, rs6000-nat.o
and xcoffsolib.o.
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.
(DONT_RELOCATE_SYMFILE_OBJFILE): Removed.
* xcoffsolib.h (struct vmap): Add new members tvma, toffs and dvma,
remove tadj.
* exec.c (bfdsec_to_vmap): Initialize new vmap members, initialize
tstart and dstart with section VMA.
* rs6000-nat.c (vmap_symtab): Relocate relative to the VMA in the
object file.
(vmap_ldinfo, xcoff_relocate_core): Adjust tstart by section offset
of the text section, remove DONT_RELOCATE_SYMFILE_OBJFILE hack.
(vmap_exec): Relocate relative to the VMA in the object file,
relocate .bss section as well.
(xcoff_relocate_core): No longer adjust section addresses by VMA.
* rs6000-tdep.c (find_toc_address): Change type of tocbase
to CORE_ADDR.
* xcoffread.c (secnum_to_bfd_section): New routine to get
BFD section from CS section number.
(scan_xcoff_symtab): Make toc_offset section relative.
* symtab.c (total_number_of_methods): Avoid core dump if
baseclass type is still undefined.
* 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.
* xcoffexec.c: Reformat to standards and lint.
(language.h): Include.
(exec_close): Declare arg "quitting".
(file_command): Declare arg "from_tty".
(map_vmap): Cast xmalloc result to PTR.
* rs6000-nat.c: Reformat to standards and lint.
(exec_one_dummy_insn): Use char array for saved instruction.
(fixup_breakpoints): Declare.
(vmap_ldinfo): Be more informative in fatal error messages.
(xcoff_relocate_symtab): Define to return void.
* xcoffsolib.h: Reformat to standards, improve comments.
* config/rs6000/nm-rs6000.h (xcoff_relocate_symtab): Declare.
* xcoffread.c (retrieve_tracebackinfo): Move assignment out
of while condition.
* xcoffread.c (enter_line_range): complain() on bad endoffset.
xcoffread.c: Doc fixes.
Tue Mar 9 09:56:12 1993 Jim Kingdon (kingdon@cygnus.com)
* tm-rs6000.h (CORE_NEEDS_RELOCATION): Just call xcoff_relocate_core.
xcoffexec.c (xcoff_relocate_core): New function.
(text_adjustment): Removed.
(add_vmap): Return the vmap.
rs6000-tdep.c (add_text_to_loadinfo): No longer static.
Fri Mar 5 05:22:46 1993 Jim Kingdon (kingdon@cygnus.com)
* xcoffsolib.h: Add objfile member to struct vmap.
xcoff{exec,solib}.c: Use it, not lookup_objfile_bfd.
xcoffexec.c (add_vmap): Allocate objfiles here.