(sh_gdbarch_init): Remove redundant prototype.
* sh-linux-tdep.c: New file.
* config/sh/tm-linux.h (sh_linux_svr4_fetch_link_map_offsets):
Remove prototype.
(SVR4_FETCH_LINK_MAP_OFFSETS): Remove define.
* config/sh/linux.mt (TDEPFILES): Add sh64-tdep.o, remove
solib-legacy.o.
* Makefile.in (sh-linux-tdep.o): New.
2005-04-27 Mark Kettenis <kettenis@gnu.org>
+ * sh-tdep.c (sh_linux_svr4_fetch_link_map_offsets): Remove function.
+ (sh_gdbarch_init): Remove redundant prototype.
+ * sh-linux-tdep.c: New file.
+ * config/sh/tm-linux.h (sh_linux_svr4_fetch_link_map_offsets):
+ Remove prototype.
+ (SVR4_FETCH_LINK_MAP_OFFSETS): Remove define.
+ * config/sh/linux.mt (TDEPFILES): Add sh64-tdep.o, remove
+ solib-legacy.o.
+ * Makefile.in (sh-linux-tdep.o): New.
+
* solib-svr4.c: Update copyright year. Include "gdb_assert.h".
(SVR4_FETCH_LINK_MAP_OFFSETS): Don't define if not already
defined.
$(osabi_h) $(solib_svr4_h) $(nbsd_tdep_h) $(sh_tdep_h) \
$(shnbsd_tdep_h)
sh-stub.o: sh-stub.c
+sh-linux-tdep.o: sh-linux-tdep.c $(defs_h) $(osabi_h) $(solib_svr4_h)
sh-tdep.o: sh-tdep.c $(defs_h) $(frame_h) $(frame_base_h) $(frame_unwind_h) \
$(dwarf2_frame_h) $(symtab_h) $(gdbtypes_h) $(gdbcmd_h) $(gdbcore_h) \
$(value_h) $(dis_asm_h) $(inferior_h) $(gdb_string_h) \
-# Target: Renesas Super-H running GNU/Linux
-TDEPFILES= sh-tdep.o monitor.o sh3-rom.o remote-e7000.o ser-e7kpc.o dsrec.o solib.o solib-svr4.o solib-legacy.o symfile-mem.o
+# Target: GNU/Linux Super-H
+TDEPFILES= sh-tdep.o sh64-tdep.o sh-linux-tdep.o \
+ monitor.o sh3-rom.o remote-e7000.o ser-e7kpc.o dsrec.o \
+ solib.o solib-svr4.o symfile-mem.o
DEPRECATED_TM_FILE= tm-linux.h
SIM_OBS = remote-sim.o
/* Pull in sh-target defs */
#include "sh/tm-sh.h"
-/* Use target_specific function to define link map offsets. */
-extern struct link_map_offsets *sh_linux_svr4_fetch_link_map_offsets (void);
-#define SVR4_FETCH_LINK_MAP_OFFSETS() sh_linux_svr4_fetch_link_map_offsets ()
-
--- /dev/null
+/* Target-dependent code for GNU/Linux Super-H.
+
+ Copyright 2005 Free Software Foundation, Inc.
+
+ This file is part of GDB.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA. */
+
+#include "defs.h"
+#include "osabi.h"
+
+#include "solib-svr4.h"
+
+static void
+sh_linux_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch)
+{
+ /* GNU/Linux uses SVR4-style shared libraries. */
+ set_solib_svr4_fetch_link_map_offsets
+ (gdbarch, svr4_ilp32_fetch_link_map_offsets);
+}
+
+/* Provide a prototype to silence -Wmissing-prototypes. */
+extern void _initialize_sh_linux_tdep (void);
+
+void
+_initialize_sh_linux_tdep (void)
+{
+ gdbarch_register_osabi (bfd_arch_sh, 0, GDB_OSABI_LINUX, sh_linux_init_abi);
+}
}
}
-/* Fetch (and possibly build) an appropriate link_map_offsets structure
- for native i386 linux targets using the struct offsets defined in
- link.h (but without actual reference to that file).
-
- This makes it possible to access i386-linux shared libraries from
- a gdb that was not built on an i386-linux host (for cross debugging).
- */
-
-struct link_map_offsets *
-sh_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; /* 20 not actual size but all we need */
-
- lmo.r_map_offset = 4;
- lmo.r_map_size = 4;
-
- lmo.link_map_size = 20; /* 552 not actual size but 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 int
sh_dsp_register_sim_regno (int nr)
{
}
return 0;
}
-
-static gdbarch_init_ftype sh_gdbarch_init;
+\f
static struct gdbarch *
sh_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)