This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
[COMMIT] Fix GNU/Linux Super-H build
- From: Mark Kettenis <mark dot kettenis at xs4all dot nl>
- To: gdb-patches at sourceware dot org
- Date: Wed, 27 Apr 2005 22:49:30 +0200 (CEST)
- Subject: [COMMIT] Fix GNU/Linux Super-H build
Looks like there was something wrong with the solib-svr4.c patch after
all. Not that sh-*-linux* did compile in the first place. So I did
something radical and fixed things the proper way. This is untested,
but at least I can build for sh-linux on my i386-*-openbsd3.7 system
again (if I fix some problems in the simulator code).
This allows me to get rid of SVR4_FETCH_LINK_MAP_OFFSETS completely,
and makes life much easier for me while working on more solib.c
cleanups.
Mark
Index: ChangeLog
from 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.
Index: Makefile.in
===================================================================
RCS file: /cvs/src/src/gdb/Makefile.in,v
retrieving revision 1.722
diff -u -p -r1.722 Makefile.in
--- Makefile.in 27 Apr 2005 14:30:13 -0000 1.722
+++ Makefile.in 27 Apr 2005 20:43:40 -0000
@@ -2505,6 +2505,7 @@ shnbsd-tdep.o: shnbsd-tdep.c $(defs_h) $
$(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) \
Index: sh-linux-tdep.c
===================================================================
RCS file: sh-linux-tdep.c
diff -N sh-linux-tdep.c
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ sh-linux-tdep.c 27 Apr 2005 20:43:40 -0000
@@ -0,0 +1,42 @@
+/* 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);
+}
Index: sh-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/sh-tdep.c,v
retrieving revision 1.186
diff -u -p -r1.186 sh-tdep.c
--- sh-tdep.c 15 Apr 2005 08:01:14 -0000 1.186
+++ sh-tdep.c 27 Apr 2005 20:43:42 -0000
@@ -2152,47 +2152,6 @@ sh_print_registers_info (struct gdbarch
}
}
-/* 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)
{
@@ -2513,8 +2472,7 @@ sh_in_function_epilogue_p (struct gdbarc
}
return 0;
}
-
-static gdbarch_init_ftype sh_gdbarch_init;
+
static struct gdbarch *
sh_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
Index: config/sh/linux.mt
===================================================================
RCS file: /cvs/src/src/gdb/config/sh/linux.mt,v
retrieving revision 1.9
diff -u -p -r1.9 linux.mt
--- config/sh/linux.mt 9 Feb 2005 15:58:51 -0000 1.9
+++ config/sh/linux.mt 27 Apr 2005 20:43:42 -0000
@@ -1,5 +1,7 @@
-# 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
Index: config/sh/tm-linux.h
===================================================================
RCS file: /cvs/src/src/gdb/config/sh/tm-linux.h,v
retrieving revision 1.5
diff -u -p -r1.5 tm-linux.h
--- config/sh/tm-linux.h 10 Oct 2003 07:13:11 -0000 1.5
+++ config/sh/tm-linux.h 27 Apr 2005 20:43:42 -0000
@@ -26,7 +26,3 @@
/* 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 ()
-