Add cross platform SVR4 shared library support for PowerPC.
[deliverable/binutils-gdb.git] / gdb / ppc-linux-tdep.c
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;
+}
This page took 0.024829 seconds and 4 git commands to generate.