aboutsummaryrefslogtreecommitdiff
path: root/gdb/ppc-linux-tdep.c
diff options
context:
space:
mode:
authorKevin Buettner <kevinb@redhat.com>2001-12-01 00:25:08 +0000
committerKevin Buettner <kevinb@redhat.com>2001-12-01 00:25:08 +0000
commit6ded7999cda94104758893ee6cd00fe17d584ba2 (patch)
tree571e07e996ab26c752652cbd5f7527d77e351c6d /gdb/ppc-linux-tdep.c
parent7e74fa0edf05215626b6f841eb69b50976343f47 (diff)
downloadgdb-6ded7999cda94104758893ee6cd00fe17d584ba2.zip
gdb-6ded7999cda94104758893ee6cd00fe17d584ba2.tar.gz
gdb-6ded7999cda94104758893ee6cd00fe17d584ba2.tar.bz2
Add cross platform SVR4 shared library support for PowerPC.
Diffstat (limited to 'gdb/ppc-linux-tdep.c')
-rw-r--r--gdb/ppc-linux-tdep.c41
1 files changed, 41 insertions, 0 deletions
diff --git a/gdb/ppc-linux-tdep.c b/gdb/ppc-linux-tdep.c
index 06fc294..fb60385 100644
--- a/gdb/ppc-linux-tdep.c
+++ b/gdb/ppc-linux-tdep.c
@@ -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;
+}