[commit] Skip solib resolver for Solaris

Mark Kettenis mark.kettenis@xs4all.nl
Sun Jan 15 00:24:00 GMT 2006


This is a first step towards fixing PR 2063.  Unfortunately there is
also some breakage in solib-svr4.c that I need to fix properly.

Mark

Index: ChangeLog
from  Mark Kettenis  <kettenis@gnu.org>

	* sol2-tdep.h. sol2-tdep.c: New files.
	* amd64-sol2-tdep.c: Include "sol2-tdep.h".
	(amd64_sol2_init_abi): Set skip_solib_resolver.
	* i386-sol2-tdep.c: Include "sol2-tdep.h".
	(i386_sol2_init_abi): Set skip_solib_resolver.
	* sparc-sol2-tdep.c: Include "sol2-tdep.h".
	(sparc32_sol2_init_abi): Set skip_solib_resolver.
	* sparc64-sol2-tdep.c: Include "sol2-tdep.h".
	(sparc64_sol2_init_abi): Set skip_solib_resolver.
	* Makefile.in (sol2_tdep_h): New variable.
	(ALLDEPFILES): Add sol2-tdep.c.
	(sol2-tdep.o): New target.
	(amd64-sol2-tdep.o, i386-sol2-tdep.o, sparc-sol2-tdep.o)
	(sparc64-sol2-tdep.o): Update dependencies
	* config/i386/i386sol2.mt (TDEPFILES): Add sol2-tdep.o.
	* config/i386/sol2-64.mt (TDEPFILES): Add sol2-tdep.o.
	* config/sparc/sol2.mt (TDEPFILES): Add sol2-tdep.o.
	* config/sparc/sol2-64.mt (TDEPFILES): Add sol2-tdep.o.

Index: Makefile.in
===================================================================
RCS file: /cvs/src/src/gdb/Makefile.in,v
retrieving revision 1.773
diff -u -p -r1.773 Makefile.in
--- Makefile.in 7 Jan 2006 14:17:16 -0000 1.773
+++ Makefile.in 15 Jan 2006 00:19:52 -0000
@@ -768,6 +768,7 @@ ser_unix_h = ser-unix.h
 shnbsd_tdep_h = shnbsd-tdep.h
 sh_tdep_h = sh-tdep.h
 sim_regno_h = sim-regno.h
+sol2_tdep_h = sol2-tdep.h
 solib_h = solib.h
 solib_pa64_h = solib-pa64.h
 solib_som_h = solib-som.h
@@ -1441,6 +1442,7 @@ ALLDEPFILES = \
 	s390-tdep.c s390-nat.c \
 	ser-go32.c ser-pipe.c ser-tcp.c \
 	sh-tdep.c sh64-tdep.c shnbsd-tdep.c shnbsd-nat.c \
+	sol2-tdep.c \
 	solib-irix.c solib-svr4.c solib-sunos.c \
 	sparc-linux-nat.c \
 	sparc-linux-tdep.c sparc-nat.c sparc-sol2-nat.c sparc-sol2-tdep.c \
@@ -1723,8 +1725,8 @@ amd64obsd-tdep.o: amd64obsd-tdep.c $(def
 	$(gdb_string_h) $(amd64_tdep_h) $(i387_tdep_h) $(solib_svr4_h) \
 	$(bsd_uthread_h)
 amd64-sol2-tdep.o: amd64-sol2-tdep.c $(defs_h) $(frame_h) $(gdbcore_h) \
-	$(regcache_h) $(osabi_h) $(symtab_h) $(gdb_string_h) $(amd64_tdep_h) \
-	$(solib_svr4_h)
+	$(regcache_h) $(osabi_h) $(symtab_h) $(gdb_string_h) \
+	$(sol2_tdep_h) $(amd64_tdep_h) $(solib_svr4_h)
 amd64-tdep.o: amd64-tdep.c $(defs_h) $(arch_utils_h) $(block_h) \
 	$(dummy_frame_h) $(frame_h) $(frame_base_h) $(frame_unwind_h) \
 	$(inferior_h) $(gdbcmd_h) $(gdbcore_h) $(objfiles_h) $(regcache_h) \
@@ -2081,7 +2083,7 @@ i386obsd-tdep.o: i386obsd-tdep.c $(defs_
 i386-sol2-nat.o: i386-sol2-nat.c $(defs_h) $(regcache_h) $(gregset_h) \
 	$(amd64_nat_h) $(amd64_tdep_h)
 i386-sol2-tdep.o: i386-sol2-tdep.c $(defs_h) $(value_h) $(osabi_h) \
-	$(gdb_string_h) $(i386_tdep_h) $(solib_svr4_h)
+	$(gdb_string_h) $(sol2_tdep_h) $(i386_tdep_h) $(solib_svr4_h)
 i386-stub.o: i386-stub.c
 i386-tdep.o: i386-tdep.c $(defs_h) $(arch_utils_h) $(command_h) \
 	$(dummy_frame_h) $(dwarf2_frame_h) $(doublest_h) $(floatformat_h) \
@@ -2543,6 +2545,7 @@ sh-tdep.o: sh-tdep.c $(defs_h) $(frame_h
 	$(gdb_assert_h) $(arch_utils_h) $(floatformat_h) $(regcache_h) \
 	$(doublest_h) $(osabi_h) $(sh_tdep_h) $(elf_bfd_h) $(solib_svr4_h) \
 	$(elf_sh_h) $(gdb_sim_sh_h)
+sol2-tdep.o: sol2-tdep.c $(defs_h) $(frame_h) $(symtab_h)
 solib-aix5.o: solib-aix5.c $(defs_h) $(gdb_string_h) $(elf_external_h) \
 	$(symtab_h) $(bfd_h) $(symfile_h) $(objfiles_h) $(gdbcore_h) \
 	$(command_h) $(target_h) $(frame_h) $(gdb_regex_h) $(inferior_h) \
Index: amd64-sol2-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/amd64-sol2-tdep.c,v
retrieving revision 1.2
diff -u -p -r1.2 amd64-sol2-tdep.c
--- amd64-sol2-tdep.c 17 Dec 2005 22:33:59 -0000 1.2
+++ amd64-sol2-tdep.c 15 Jan 2006 00:19:52 -0000
@@ -1,6 +1,7 @@
 /* Target-dependent code for AMD64 Solaris.
 
-   Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
+   Copyright (C) 2001, 2002, 2003, 2004, 2006 Free Software Foundation, Inc.
+
    Contributed by Joseph Myers, CodeSourcery, LLC.
 
    This file is part of GDB.
@@ -29,6 +30,7 @@
 
 #include "gdb_string.h"
 
+#include "sol2-tdep.h"
 #include "amd64-tdep.h"
 #include "solib-svr4.h"
 
@@ -109,6 +111,7 @@ amd64_sol2_init_abi (struct gdbarch_info
   tdep->sc_num_regs = tdep->gregset_num_regs;
 
   /* Solaris uses SVR4-style shared libraries.  */
+  set_gdbarch_skip_solib_resolver (gdbarch, sol2_skip_solib_resolver);
   set_solib_svr4_fetch_link_map_offsets
     (gdbarch, svr4_lp64_fetch_link_map_offsets);
 }
Index: i386-sol2-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/i386-sol2-tdep.c,v
retrieving revision 1.18
diff -u -p -r1.18 i386-sol2-tdep.c
--- i386-sol2-tdep.c 17 Dec 2005 22:34:01 -0000 1.18
+++ i386-sol2-tdep.c 15 Jan 2006 00:19:53 -0000
@@ -1,6 +1,6 @@
 /* Target-dependent code for Solaris x86.
 
-   Copyright (C) 2002, 2003, 2004 Free Software Foundation, Inc.
+   Copyright (C) 2002, 2003, 2004, 2006 Free Software Foundation, Inc.
 
    This file is part of GDB.
 
@@ -25,6 +25,7 @@
 
 #include "gdb_string.h"
 
+#include "sol2-tdep.h"
 #include "i386-tdep.h"
 #include "solib-svr4.h"
 
@@ -101,6 +102,8 @@ i386_sol2_init_abi (struct gdbarch_info 
   tdep->sc_reg_offset = tdep->gregset_reg_offset;
   tdep->sc_num_regs = tdep->gregset_num_regs;
 
+  /* Solaris has SVR4-style shared libraries.  */
+  set_gdbarch_skip_solib_resolver (gdbarch, sol2_skip_solib_resolver);
   set_solib_svr4_fetch_link_map_offsets
     (gdbarch, svr4_ilp32_fetch_link_map_offsets);
 }
Index: sol2-tdep.c
===================================================================
RCS file: sol2-tdep.c
diff -N sol2-tdep.c
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ sol2-tdep.c 15 Jan 2006 00:19:53 -0000
@@ -0,0 +1,38 @@
+/* Target-dependent code for Solaris.
+
+   Copyright (C) 2006 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., 51 Franklin Street, Fifth Floor,
+   Boston, MA 02110-1301, USA.  */
+
+#include "defs.h"
+#include "frame.h"
+#include "symtab.h"
+
+#include "sol2-tdep.h"
+
+CORE_ADDR
+sol2_skip_solib_resolver (struct gdbarch *gdbarch, CORE_ADDR pc)
+{
+  struct minimal_symbol *msym;
+
+  msym = lookup_minimal_symbol("elf_bndr", NULL, NULL);
+  if (msym && SYMBOL_VALUE_ADDRESS (msym) == pc)
+    return frame_pc_unwind (get_current_frame ());
+
+  return 0;
+}
Index: sol2-tdep.h
===================================================================
RCS file: sol2-tdep.h
diff -N sol2-tdep.h
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ sol2-tdep.h 15 Jan 2006 00:19:53 -0000
@@ -0,0 +1,29 @@
+/* Target-dependent code for Solaris.
+
+   Copyright (C) 2006 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., 51 Franklin Street, Fifth Floor,
+   Boston, MA 02110-1301, USA.  */
+
+#ifndef SOL2_TDEP_H
+#define SOL2_TDEP_H 1
+
+struct gdbarch;
+
+CORE_ADDR sol2_skip_solib_resolver (struct gdbarch *, CORE_ADDR);
+
+#endif /* sol2-tdep.h */
Index: sparc-sol2-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/sparc-sol2-tdep.c,v
retrieving revision 1.10
diff -u -p -r1.10 sparc-sol2-tdep.c
--- sparc-sol2-tdep.c 17 Dec 2005 22:34:02 -0000 1.10
+++ sparc-sol2-tdep.c 15 Jan 2006 00:19:53 -0000
@@ -1,6 +1,6 @@
 /* Target-dependent code for Solaris SPARC.
 
-   Copyright (C) 2003, 2004 Free Software Foundation, Inc.
+   Copyright (C) 2003, 2004, 2006 Free Software Foundation, Inc.
 
    This file is part of GDB.
 
@@ -33,6 +33,7 @@
 #include "gdb_assert.h"
 #include "gdb_string.h"
 
+#include "sol2-tdep.h"
 #include "sparc-tdep.h"
 #include "solib-svr4.h"
 
@@ -178,6 +179,7 @@ sparc32_sol2_init_abi (struct gdbarch_in
 
   /* Solaris has SVR4-style shared libraries...  */
   set_gdbarch_skip_trampoline_code (gdbarch, find_solib_trampoline_target);
+  set_gdbarch_skip_solib_resolver (gdbarch, sol2_skip_solib_resolver);
   set_solib_svr4_fetch_link_map_offsets
     (gdbarch, svr4_ilp32_fetch_link_map_offsets);
 
Index: sparc64-sol2-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/sparc64-sol2-tdep.c,v
retrieving revision 1.9
diff -u -p -r1.9 sparc64-sol2-tdep.c
--- sparc64-sol2-tdep.c 17 Dec 2005 22:34:02 -0000 1.9
+++ sparc64-sol2-tdep.c 15 Jan 2006 00:19:53 -0000
@@ -1,6 +1,6 @@
 /* Target-dependent code for Solaris UltraSPARC.
 
-   Copyright (C) 2003, 2004 Free Software Foundation, Inc.
+   Copyright (C) 2003, 2004, 2006 Free Software Foundation, Inc.
 
    This file is part of GDB.
 
@@ -30,6 +30,7 @@
 
 #include "gdb_assert.h"
 
+#include "sol2-tdep.h"
 #include "sparc64-tdep.h"
 #include "solib-svr4.h"
 
@@ -160,6 +161,7 @@ sparc64_sol2_init_abi (struct gdbarch_in
 
   /* Solaris has SVR4-style shared libraries...  */
   set_gdbarch_skip_trampoline_code (gdbarch, find_solib_trampoline_target);
+  set_gdbarch_skip_solib_resolver (gdbarch, sol2_skip_solib_resolver);
   set_solib_svr4_fetch_link_map_offsets
     (gdbarch, svr4_lp64_fetch_link_map_offsets);
 
Index: config/i386/i386sol2.mt
===================================================================
RCS file: /cvs/src/src/gdb/config/i386/i386sol2.mt,v
retrieving revision 1.8
diff -u -p -r1.8 i386sol2.mt
--- config/i386/i386sol2.mt 13 Sep 2004 20:55:39 -0000 1.8
+++ config/i386/i386sol2.mt 15 Jan 2006 00:19:53 -0000
@@ -1,4 +1,4 @@
 # Target: Solaris x86
-TDEPFILES= i386-tdep.o i387-tdep.o i386-sol2-tdep.o \
+TDEPFILES= i386-tdep.o i387-tdep.o i386-sol2-tdep.o sol2-tdep.o \
 	corelow.o solib.o solib-svr4.o
 DEPRECATED_TM_FILE= tm-i386sol2.h
Index: config/i386/sol2-64.mt
===================================================================
RCS file: /cvs/src/src/gdb/config/i386/sol2-64.mt,v
retrieving revision 1.1
diff -u -p -r1.1 sol2-64.mt
--- config/i386/sol2-64.mt 1 Nov 2004 21:05:56 -0000 1.1
+++ config/i386/sol2-64.mt 15 Jan 2006 00:19:53 -0000
@@ -1,3 +1,3 @@
 # Target: Solaris x86_64
 TDEPFILES= i386-tdep.o i387-tdep.o amd64-tdep.o amd64-sol2-tdep.o \
-	i386-sol2-tdep.o corelow.o solib.o solib-svr4.o
+	i386-sol2-tdep.o sol2-tdep.o corelow.o solib.o solib-svr4.o
Index: config/sparc/sol2-64.mt
===================================================================
RCS file: /cvs/src/src/gdb/config/sparc/sol2-64.mt,v
retrieving revision 1.3
diff -u -p -r1.3 sol2-64.mt
--- config/sparc/sol2-64.mt 13 Sep 2004 20:55:42 -0000 1.3
+++ config/sparc/sol2-64.mt 15 Jan 2006 00:19:53 -0000
@@ -1,4 +1,4 @@
 # Target: Solaris UltraSPARC
 TDEPFILES= sparc64-tdep.o sparc64-sol2-tdep.o sparc-tdep.o sparc-sol2-tdep.o \
-	solib.o solib-svr4.o
+	sol2-tdep.o solib.o solib-svr4.o
 DEPRECATED_TM_FILE= tm-sol2.h
Index: config/sparc/sol2.mt
===================================================================
RCS file: /cvs/src/src/gdb/config/sparc/sol2.mt,v
retrieving revision 1.4
diff -u -p -r1.4 sol2.mt
--- config/sparc/sol2.mt 13 Sep 2004 20:55:42 -0000 1.4
+++ config/sparc/sol2.mt 15 Jan 2006 00:19:54 -0000
@@ -1,3 +1,3 @@
 # Target: Solaris SPARC
-TDEPFILES= sparc-tdep.o sparc-sol2-tdep.o solib.o solib-svr4.o
+TDEPFILES= sparc-tdep.o sparc-sol2-tdep.o sol2-tdep.o solib.o solib-svr4.o
 DEPRECATED_TM_FILE= tm-sol2.h



More information about the Gdb-patches mailing list