+2001-11-30 Kevin Buettner <kevinb@redhat.com>
+
+ * ppc-linux-tdep.c (solib-svr4.h): Include.
+ (ppc_linux_svr4_fetch_link_map_offsets): New function.
+ * ppc-tdep.h (ppc_linux_svr4_fetch_link_map_offsets): Declare.
+ * rs6000-tdep.c (solib-svr4.h): Include.
+ (rs6000_gdbarch_init): Set up ppc_linux_svr4_fetch_link_map_offsets()
+ as the link map offsets fetcher.
+
+ * config/powerpc/aix.mt (TDEPFILES): Add solib-svr4.o.
+ * config/powerpc/macos.mt (TDEPFILES): Likewise.
+ * config/powerpc/nbsd.mt (TDEPFILES): Likewise.
+ * config/powerpc/ppc-eabi.mt (TDEPFILES): Likewise.
+ * config/powerpc/ppc-sim.mt (TDEPFILES): Likewise.
+ * config/powerpc/ppcle-eabi.mt (TDEPFILES): Likewise.
+ * config/powerpc/ppcle-sim.mt (TDEPFILES): Likewise.
+ * config/powerpc/vxworks.mt (TDEPFILES): Likewise.
+ * config/rs6000/aix4.mt (TDEPFILES): Likewise.
+ * config/rs6000/rs6000.mt (TDEPFILES): Likewise.
+ * config/rs6000/rs6000lynx.mt (TDEPFILES): Likewise.
+
2001-11-30 Kevin Buettner <kevinb@redhat.com>
From Louis Hamilton <hamilton@redhat.com>:
# Target: PowerPC running AIX
-TDEPFILES= rs6000-tdep.o ppc-linux-tdep.o
+TDEPFILES= rs6000-tdep.o ppc-linux-tdep.o solib.o solib-svr4.o
TM_FILE= tm-ppc-aix.h
# Target: PowerMac (PowerPC running MacOS)
-TDEPFILES= rs6000-tdep.o xcoffread.o ppc-linux-tdep.o
+TDEPFILES= rs6000-tdep.o xcoffread.o ppc-linux-tdep.o solib.o solib-svr4.o
TM_FILE= tm-macos.h
# Target: PowerPC, running NetBSD
-TDEPFILES= rs6000-tdep.o ppc-linux-tdep.o
+TDEPFILES= rs6000-tdep.o ppc-linux-tdep.o solib.o solib-svr4.o
TM_FILE= tm-nbsd.h
GDBSERVER_DEPFILES= low-nbsd.o
# Target: PowerPC running eabi
-TDEPFILES= rs6000-tdep.o monitor.o dsrec.o ppcbug-rom.o dink32-rom.o ppc-bdm.o ocd.o remote-sds.o ppc-linux-tdep.o
+TDEPFILES= rs6000-tdep.o monitor.o dsrec.o ppcbug-rom.o dink32-rom.o ppc-bdm.o ocd.o remote-sds.o ppc-linux-tdep.o solib.o solib-svr4.o
TM_FILE= tm-ppc-eabi.h
# Target: PowerPC running eabi and including the simulator
-TDEPFILES= rs6000-tdep.o monitor.o dsrec.o ppcbug-rom.o dink32-rom.o ppc-bdm.o ocd.o remote-sds.o ppc-linux-tdep.o
+TDEPFILES= rs6000-tdep.o monitor.o dsrec.o ppcbug-rom.o dink32-rom.o ppc-bdm.o ocd.o remote-sds.o ppc-linux-tdep.o solib.o solib-svr4.o
TM_FILE= tm-ppc-eabi.h
SIM_OBS = remote-sim.o
# Target: PowerPC running eabi in little endian mode
-TDEPFILES= rs6000-tdep.o monitor.o dsrec.o ppcbug-rom.o ppc-bdm.o ocd.o ppc-linux-tdep.o
+TDEPFILES= rs6000-tdep.o monitor.o dsrec.o ppcbug-rom.o ppc-bdm.o ocd.o ppc-linux-tdep.o solib.o solib-svr4.o
TM_FILE= tm-ppcle-eabi.h
# Target: PowerPC running eabi in little endian mode under the simulator
-TDEPFILES= rs6000-tdep.o monitor.o dsrec.o ppcbug-rom.o ppc-bdm.o ocd.o ppc-linux-tdep.o
+TDEPFILES= rs6000-tdep.o monitor.o dsrec.o ppcbug-rom.o ppc-bdm.o ocd.o ppc-linux-tdep.o solib.o solib-svr4.o
TM_FILE= tm-ppcle-eabi.h
SIM_OBS = remote-sim.o
# Target: Powerpc running VxWorks
-TDEPFILES= rs6000-tdep.o ppc-linux-tdep.o
+TDEPFILES= rs6000-tdep.o ppc-linux-tdep.o solib.o solib-svr4.o
TM_FILE= tm-vxworks.h
# Target: IBM RS/6000 running AIX4
-TDEPFILES= rs6000-tdep.o xcoffread.o ppc-linux-tdep.o
+TDEPFILES= rs6000-tdep.o xcoffread.o ppc-linux-tdep.o solib.o solib-svr4.o
TM_FILE= tm-rs6000-aix4.h
# Target: IBM RS/6000 running AIX
-TDEPFILES= rs6000-tdep.o xcoffread.o ppc-linux-tdep.o
+TDEPFILES= rs6000-tdep.o xcoffread.o ppc-linux-tdep.o solib.o solib-svr4.o
TM_FILE= tm-rs6000.h
# Target: IBM RS6000 running LynxOS
-TDEPFILES= coff-solib.o rs6000-tdep.o ppc-linux-tdep.o
+TDEPFILES= coff-solib.o rs6000-tdep.o ppc-linux-tdep.o solib.o solib-svr4.o
TM_FILE= tm-rs6000ly.h
#include "regcache.h"
#include "value.h"
+#include "solib-svr4.h"
#include "ppc-tdep.h"
/* The following two instructions are used in the signal trampoline
return val;
}
+
+/* Fetch (and possibly build) an appropriate link_map_offsets
+ structure for Linux/PPC targets using the struct offsets
+ defined in link.h (but without actual reference to that file).
+
+ This makes it possible to access Linux/PPC shared libraries from a
+ GDB that was not built on an Linux/PPC host (for cross debugging). */
+
+struct link_map_offsets *
+ppc_linux_svr4_fetch_link_map_offsets (void)
+{
+ static struct link_map_offsets lmo;
+ static struct link_map_offsets *lmp = NULL;
+
+ if (lmp == NULL)
+ {
+ lmp = &lmo;
+
+ lmo.r_debug_size = 8; /* The actual size is 20 bytes, but
+ this is all we need. */
+ lmo.r_map_offset = 4;
+ lmo.r_map_size = 4;
+
+ lmo.link_map_size = 20; /* The actual size is 560 bytes, but
+ this is all we need. */
+ lmo.l_addr_offset = 0;
+ lmo.l_addr_size = 4;
+
+ lmo.l_name_offset = 4;
+ lmo.l_name_size = 4;
+
+ lmo.l_next_offset = 12;
+ lmo.l_next_size = 4;
+
+ lmo.l_prev_offset = 16;
+ lmo.l_prev_size = 4;
+ }
+
+ return lmp;
+}
CORE_ADDR ppc_sysv_abi_push_arguments (int, struct value **, CORE_ADDR, int,
CORE_ADDR);
int ppc_linux_memory_remove_breakpoint (CORE_ADDR addr, char *contents_cache);
+struct link_map_offsets *ppc_linux_svr4_fetch_link_map_offsets (void);
/* From rs6000-tdep.c... */
#include "elf-bfd.h"
+#include "solib-svr4.h"
#include "ppc-tdep.h"
/* If the kernel has to deliver a signal, it pushes a sigcontext
set_gdbarch_memory_remove_breakpoint (gdbarch,
ppc_linux_memory_remove_breakpoint);
+ set_solib_svr4_fetch_link_map_offsets
+ (gdbarch, ppc_linux_svr4_fetch_link_map_offsets);
}
else
{