]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
Add cross platform SVR4 shared library support for PowerPC.
authorKevin Buettner <kevinb@redhat.com>
Sat, 1 Dec 2001 00:25:08 +0000 (00:25 +0000)
committerKevin Buettner <kevinb@redhat.com>
Sat, 1 Dec 2001 00:25:08 +0000 (00:25 +0000)
15 files changed:
gdb/ChangeLog
gdb/config/powerpc/aix.mt
gdb/config/powerpc/macos.mt
gdb/config/powerpc/nbsd.mt
gdb/config/powerpc/ppc-eabi.mt
gdb/config/powerpc/ppc-sim.mt
gdb/config/powerpc/ppcle-eabi.mt
gdb/config/powerpc/ppcle-sim.mt
gdb/config/powerpc/vxworks.mt
gdb/config/rs6000/aix4.mt
gdb/config/rs6000/rs6000.mt
gdb/config/rs6000/rs6000lynx.mt
gdb/ppc-linux-tdep.c
gdb/ppc-tdep.h
gdb/rs6000-tdep.c

index aa767ca1b12e1b8ca9e2fdf1f9b642011a2f54c6..3d6c370fd0b462c36376aad71c0701314fb483b9 100644 (file)
@@ -1,3 +1,24 @@
+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>:
index 985f71bd554387133d47803c5f4f68d3cac0cbf3..51bb625c77a27f0fb6aa0580bd03a7a07a1af6af 100644 (file)
@@ -1,3 +1,3 @@
 # 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
index 061d9d612c6712ab975f57aaea869f94461f9635..31a4fdf9d9426d9fc642c96f557ba10019564bf9 100644 (file)
@@ -1,3 +1,3 @@
 # 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
index acc5da804cac60655113627e4f1400d04e864466..46e6541d8e8b2286bf87009983b864be4a2cf808 100644 (file)
@@ -1,5 +1,5 @@
 # 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
index 2751e1d0baf872193bda5ad1934cb8cbb53a2ade..2d4a77fcdefb51716a543c47a8474c5d890a5a77 100644 (file)
@@ -1,3 +1,3 @@
 # 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
index a647cadd9d733ee29bffe57b28b5ca17fc2efe34..f2ad1f0b2c43ecea119893124c0196dbbd6510bc 100644 (file)
@@ -1,5 +1,5 @@
 # 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
index 202c6b1c8f0d450985558d7821733e2718086781..e7480975730330d5893ed82c98d6d52ef43ce357 100644 (file)
@@ -1,3 +1,3 @@
 # 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
index e3be0d8d4f4eb746ea01ac3683c99f29f2511c6c..558c0dc885e56ebaf74d41b43dd4be8eb90c01b3 100644 (file)
@@ -1,5 +1,5 @@
 # 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
index 11d8ef2a8a5ddafb28de0b474487e48e4dd3215c..ba6e17bcb1c8f09021e0f91149eb8d9245875cc1 100644 (file)
@@ -1,3 +1,3 @@
 # 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
index f1082b3a4b2864585e63effe2322b928fd7de644..fb9d0033fef15e86a6a112eb12ceb1e0affeaec5 100644 (file)
@@ -1,3 +1,3 @@
 # 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
index a9afe89495572f24f59317a903bf1ed973dc9f58..5ffcc0165a413ddb3acd027e9e10e3e2c19ce087 100644 (file)
@@ -1,3 +1,3 @@
 # 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
index fae6d8c570995b916cd4b7514cb5ef3a3df0dfb0..69aeb60c2214969dedc69930469d691ffb80eb86 100644 (file)
@@ -1,3 +1,3 @@
 # 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
index 06fc2943d9b6a63b5286518c2daee28b3444ff37..fb60385af3c1be3d6333e45a2f06101b6191d8bd 100644 (file)
@@ -32,6 +32,7 @@
 #include "regcache.h"
 #include "value.h"
 
+#include "solib-svr4.h"
 #include "ppc-tdep.h"
 
 /* The following two instructions are used in the signal trampoline
@@ -763,3 +764,43 @@ ppc_linux_memory_remove_breakpoint (CORE_ADDR addr, char *contents_cache)
 
   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;
+}
index e8552235374f1d6e5cff98f8eb761746d27a32ca..9ed1567c260d1b49a072be768c89c065515d45c8 100644 (file)
@@ -34,6 +34,7 @@ CORE_ADDR ppc_linux_frame_chain (struct frame_info *);
 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... */
index 12c6ed59b619ddaf102c8090a4967673c0d86973..445007049a9768ae441681bc8fe97e73762c60f0 100644 (file)
@@ -40,6 +40,7 @@
 
 #include "elf-bfd.h"
 
+#include "solib-svr4.h"
 #include "ppc-tdep.h"
 
 /* If the kernel has to deliver a signal, it pushes a sigcontext
@@ -2333,6 +2334,8 @@ rs6000_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
 
       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
     {