Add cross platform SVR4 shared library support for PowerPC.

This commit is contained in:
Kevin Buettner
2001-12-01 00:25:08 +00:00
parent 7e74fa0edf
commit 6ded7999cd
15 changed files with 77 additions and 11 deletions

View 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;
}