This is the mail archive of the gdb-patches@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH] i386 *BSD multi-arch tweaks


This removes the IN_SOLIB_CALL_TRAMPOLINE define from the i386 *BSD
a.out targets and moves it into the architecture description.  The
only thing config/i386/tm-netbsdaout.h does now is including
config/i386/tm-nbsd.h so perhaps it can be removed.

I'm wondering why the *BSD ELF targets don't set
IN_SOLIB_CALL_TRAMPOLINE to in_plt_section() as we do for SVR4 and
Linux.

Committed.

Mark


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

	* config/i386/tm-fbsd.h [!SVR4_SHARED_LIBS]
	(IN_SOLIB_CALL_TRAMPOLINE): Remove define.
	* config/i386/tm-nbsdaout.h (IN_SOLIB_CALL_TRAMPOLINE): Remove
	define.
	* i386bsd-tdep.c: Include "arch-utils.h".
	(i386bsd_aout_in_solib_call_trampoline): New function.
	(i386bsd_init_abi): Set in_solib_call_trampoline to
	i386bsd_aout_in_solib_call_trampoline.
	(i386nbsdelf_init_abi, i386fbsd_init_abi): Set
	in_solib_call_trampoline to generic_in_solib_call_trampoline.

Index: i386bsd-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/i386bsd-tdep.c,v
retrieving revision 1.2
diff -u -p -r1.2 i386bsd-tdep.c
--- i386bsd-tdep.c 14 Jun 2002 19:42:19 -0000 1.2
+++ i386bsd-tdep.c 30 Jun 2002 14:35:38 -0000
@@ -19,6 +19,7 @@
    Boston, MA 02111-1307, USA.  */
 
 #include "defs.h"
+#include "arch-utils.h"
 #include "frame.h"
 #include "gdbcore.h"
 #include "regcache.h"
@@ -98,6 +99,16 @@ i386bsd_sigtramp_end (CORE_ADDR pc)
 }
 
 
+/* Support for shared libraries.  */
+
+/* Return non-zero if we are in a shared library trampoline code stub.  */
+
+int
+i386bsd_aout_in_solib_call_trampoline (CORE_ADDR pc, char *name)
+{
+  return (name && !strcmp (name, "_DYNAMIC"));
+}
+
 /* Traditional BSD (4.3 BSD, still used for BSDI and 386BSD).  */
 
 /* From <machine/signal.h>.  */
@@ -110,6 +121,10 @@ i386bsd_init_abi (struct gdbarch_info in
 
   set_gdbarch_pc_in_sigtramp (gdbarch, i386bsd_pc_in_sigtramp);
 
+  /* Assume SunOS-style shared libraries.  */
+  set_gdbarch_in_solib_call_trampoline (gdbarch,
+					i386bsd_aout_in_solib_call_trampoline);
+
   tdep->jb_pc_offset = 0;
 
   tdep->sigtramp_saved_pc = i386bsd_sigtramp_saved_pc;
@@ -155,6 +170,10 @@ i386nbsdelf_init_abi (struct gdbarch_inf
   /* But ELF-based.  */
   i386_elf_init_abi (info, gdbarch);
 
+  /* NetBSD ELF uses SVR4-style shared libraries.  */
+  set_gdbarch_in_solib_call_trampoline (gdbarch,
+					generic_in_solib_call_trampoline);
+
   /* NetBSD ELF uses -fpcc-struct-return by default.  */
   tdep->struct_return = pcc_struct_return;
 
@@ -193,6 +212,10 @@ i386fbsd_init_abi (struct gdbarch_info i
 
   /* Except that it uses ELF.  */
   i386_elf_init_abi (info, gdbarch);
+
+  /* FreeBSD ELF uses SVR4-style shared libraries.  */
+  set_gdbarch_in_solib_call_trampoline (gdbarch,
+					generic_in_solib_call_trampoline);
 }
 
 /* FreeBSD 4.0-RELEASE or later.  */
Index: config/i386/tm-fbsd.h
===================================================================
RCS file: /cvs/src/src/gdb/config/i386/tm-fbsd.h,v
retrieving revision 1.8
diff -u -p -r1.8 tm-fbsd.h
--- config/i386/tm-fbsd.h 28 Jun 2002 18:44:49 -0000 1.8
+++ config/i386/tm-fbsd.h 30 Jun 2002 14:35:38 -0000
@@ -39,15 +39,4 @@
 extern CORE_ADDR i386bsd_sigtramp_start (CORE_ADDR pc);
 extern CORE_ADDR i386bsd_sigtramp_end (CORE_ADDR pc);
 
-/* Shared library support.  */
-
-#ifndef SVR4_SHARED_LIBS
-
-/* Return non-zero if we are in a shared library trampoline code stub.  */
-
-#define IN_SOLIB_CALL_TRAMPOLINE(pc, name) \
-  (name && !strcmp(name, "_DYNAMIC"))
-
-#endif /* !SVR4_SHARED_LIBS */
-
 #endif /* TM_FBSD_H */
Index: config/i386/tm-nbsdaout.h
===================================================================
RCS file: /cvs/src/src/gdb/config/i386/tm-nbsdaout.h,v
retrieving revision 1.2
diff -u -p -r1.2 tm-nbsdaout.h
--- config/i386/tm-nbsdaout.h 14 Jun 2002 19:42:20 -0000 1.2
+++ config/i386/tm-nbsdaout.h 30 Jun 2002 14:35:38 -0000
@@ -23,8 +23,4 @@
 
 #include "i386/tm-nbsd.h"
 
-/* Return non-zero if we are in a shared library trampoline code stub. */
-#define IN_SOLIB_CALL_TRAMPOLINE(pc, name) \
-  (name && !strcmp(name, "_DYNAMIC"))
-
 #endif /* TM_NBSDAOUT_H */


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]