aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Earnshaw <richard.earnshaw@arm.com>2003-06-13 14:13:13 +0000
committerRichard Earnshaw <richard.earnshaw@arm.com>2003-06-13 14:13:13 +0000
commit7aa1783e88ca057e298652d8cbf8ceda46f12401 (patch)
tree183b80bc430fb6997bad7e65c88582ef88f027d2
parenta06a29f25f5dc608a08e5ff3608923c97769faee (diff)
downloadgdb-7aa1783e88ca057e298652d8cbf8ceda46f12401.zip
gdb-7aa1783e88ca057e298652d8cbf8ceda46f12401.tar.gz
gdb-7aa1783e88ca057e298652d8cbf8ceda46f12401.tar.bz2
* arm-tdep.c (solib-svr4.h): Dont' include it.
(arm_linux_svr4_fetch_link_map_offsets): Move to ... * arm-linux-tdep.c: ... here. Make static. (arm_linux_init_abi): Register it. (solib-svr4.h): Include it. * Makefile.in: Update dependencies. * config/arm/tm-linux.h (SVR4_FETCH_LINK_MAP_OFFSETS): Delete. (arm_linux_svr4_fetch_link_map_offsets): Delete declaration.
-rw-r--r--gdb/ChangeLog11
-rw-r--r--gdb/arm-linux-tdep.c47
-rw-r--r--gdb/arm-tdep.c43
-rw-r--r--gdb/config/arm/tm-linux.h4
4 files changed, 58 insertions, 47 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index af18025..d90a9ee 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,14 @@
+2003-06-13 Richard Earnshaw <rearnsha@arm.com>
+
+ * arm-tdep.c (solib-svr4.h): Dont' include it.
+ (arm_linux_svr4_fetch_link_map_offsets): Move to ...
+ * arm-linux-tdep.c: ... here. Make static.
+ (arm_linux_init_abi): Register it.
+ (solib-svr4.h): Include it.
+ * Makefile.in: Update dependencies.
+ * config/arm/tm-linux.h (SVR4_FETCH_LINK_MAP_OFFSETS): Delete.
+ (arm_linux_svr4_fetch_link_map_offsets): Delete declaration.
+
2003-06-13 Corinna Vinschen <vinschen@redhat.com>
* h8300-tdep.c: Add definitions E_RET0_REGNUM and E_RET1_REGNUM to
diff --git a/gdb/arm-linux-tdep.c b/gdb/arm-linux-tdep.c
index 8a4bdf6..5ea3ef2 100644
--- a/gdb/arm-linux-tdep.c
+++ b/gdb/arm-linux-tdep.c
@@ -27,6 +27,7 @@
#include "frame.h"
#include "regcache.h"
#include "doublest.h"
+#include "solib-svr4.h"
#include "osabi.h"
#include "arm-tdep.h"
@@ -376,6 +377,49 @@ find_minsym_and_objfile (char *name, struct objfile **objfile_p)
}
+/* Fetch, and possibly build, an appropriate link_map_offsets structure
+ for ARM linux targets using the struct offsets defined in <link.h>.
+ Note, however, that link.h is not actually referred to in this file.
+ Instead, the relevant structs offsets were obtained from examining
+ link.h. (We can't refer to link.h from this file because the host
+ system won't necessarily have it, or if it does, the structs which
+ it defines will refer to the host system, not the target). */
+
+static struct link_map_offsets *
+arm_linux_svr4_fetch_link_map_offsets (void)
+{
+ static struct link_map_offsets lmo;
+ static struct link_map_offsets *lmp = 0;
+
+ if (lmp == 0)
+ {
+ lmp = &lmo;
+
+ lmo.r_debug_size = 8; /* Actual size is 20, but this is all we
+ need. */
+
+ lmo.r_map_offset = 4;
+ lmo.r_map_size = 4;
+
+ lmo.link_map_size = 20; /* Actual size is 552, 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;
+}
+
static CORE_ADDR
skip_hurd_resolver (CORE_ADDR pc)
{
@@ -530,6 +574,9 @@ arm_linux_init_abi (struct gdbarch_info info,
tdep->jb_pc = ARM_LINUX_JB_PC;
tdep->jb_elt_size = ARM_LINUX_JB_ELEMENT_SIZE;
+ set_solib_svr4_fetch_link_map_offsets
+ (gdbarch, arm_linux_svr4_fetch_link_map_offsets);
+
set_gdbarch_deprecated_call_dummy_words (gdbarch, arm_linux_call_dummy_words);
set_gdbarch_deprecated_sizeof_call_dummy_words (gdbarch, sizeof (arm_linux_call_dummy_words));
diff --git a/gdb/arm-tdep.c b/gdb/arm-tdep.c
index 28d2545..5184f67 100644
--- a/gdb/arm-tdep.c
+++ b/gdb/arm-tdep.c
@@ -2668,49 +2668,6 @@ arm_othernames (char *names, int n)
set_disassembly_style ();
}
-/* Fetch, and possibly build, an appropriate link_map_offsets structure
- for ARM linux targets using the struct offsets defined in <link.h>.
- Note, however, that link.h is not actually referred to in this file.
- Instead, the relevant structs offsets were obtained from examining
- link.h. (We can't refer to link.h from this file because the host
- system won't necessarily have it, or if it does, the structs which
- it defines will refer to the host system, not the target). */
-
-struct link_map_offsets *
-arm_linux_svr4_fetch_link_map_offsets (void)
-{
- static struct link_map_offsets lmo;
- static struct link_map_offsets *lmp = 0;
-
- if (lmp == 0)
- {
- lmp = &lmo;
-
- lmo.r_debug_size = 8; /* Actual size is 20, but this is all we
- need. */
-
- lmo.r_map_offset = 4;
- lmo.r_map_size = 4;
-
- lmo.link_map_size = 20; /* Actual size is 552, 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;
-}
-
/* Test whether the coff symbol specific value corresponds to a Thumb
function. */
diff --git a/gdb/config/arm/tm-linux.h b/gdb/config/arm/tm-linux.h
index bbf566d..51b9d70 100644
--- a/gdb/config/arm/tm-linux.h
+++ b/gdb/config/arm/tm-linux.h
@@ -30,10 +30,6 @@
#include "config/tm-linux.h"
-/* Use target-specific function to define link map offsets. */
-extern struct link_map_offsets *arm_linux_svr4_fetch_link_map_offsets (void);
-#define SVR4_FETCH_LINK_MAP_OFFSETS() arm_linux_svr4_fetch_link_map_offsets ()
-
/* Offset to saved PC in sigcontext structure, from <asm/sigcontext.h> */
#define SIGCONTEXT_PC_OFFSET (sizeof(unsigned long) * 18)