aboutsummaryrefslogtreecommitdiff
path: root/gdb/i386obsd-tdep.c
diff options
context:
space:
mode:
authorMark Kettenis <kettenis@gnu.org>2004-02-21 19:11:38 +0000
committerMark Kettenis <kettenis@gnu.org>2004-02-21 19:11:38 +0000
commit60a6eeb6508da2500eb912f71eb027abfdd4b70a (patch)
treef607e6caea82925a7e300f0924a482057f8c871f /gdb/i386obsd-tdep.c
parent41e0a9cab8e5aac23bf508d17cf236c4466ea251 (diff)
downloadgdb-60a6eeb6508da2500eb912f71eb027abfdd4b70a.zip
gdb-60a6eeb6508da2500eb912f71eb027abfdd4b70a.tar.gz
gdb-60a6eeb6508da2500eb912f71eb027abfdd4b70a.tar.bz2
Fix PR build/1549.
* i386obsd-tdep.c: Update copyright years. Include "solib-svr4.h". (i386obsd_init_abi): Don't set regset_from_core_section here. (i386obsd_aout_init_abi): New function. Set regset_from_core_section here. (i386obsd_elf_init_abi): New function. (_initialize_i386obsd_tdep): Register OS/ABI for OpenBSD ELF. * Makefile.in (i386obsd-tdep.o): Update dependecies. * config/i386/obsd.mt (TDEPFILES): Add solib.o and solib-svr4.o. (TM_FILE): Set to tm-nbsd.h. * config/i386/obsd.mh (NATDEPFILES): Remove solib.o and solib-sunos.o.
Diffstat (limited to 'gdb/i386obsd-tdep.c')
-rw-r--r--gdb/i386obsd-tdep.c44
1 files changed, 38 insertions, 6 deletions
diff --git a/gdb/i386obsd-tdep.c b/gdb/i386obsd-tdep.c
index 26ba4d9..be9e735 100644
--- a/gdb/i386obsd-tdep.c
+++ b/gdb/i386obsd-tdep.c
@@ -1,6 +1,7 @@
/* Target-dependent code for OpenBSD/i386.
- Copyright 1988, 1989, 1991, 1992, 1994, 1996, 2000, 2001, 2002, 2003
+ Copyright 1988, 1989, 1991, 1992, 1994, 1996, 2000, 2001, 2002,
+ 2003, 2004
Free Software Foundation, Inc.
This file is part of GDB.
@@ -32,6 +33,7 @@
#include "i386-tdep.h"
#include "i387-tdep.h"
+#include "solib-svr4.h"
/* From <machine/reg.h>. */
static int i386obsd_r_reg_offset[] =
@@ -130,10 +132,6 @@ i386obsd_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch)
tdep->gregset_num_regs = ARRAY_SIZE (i386obsd_r_reg_offset);
tdep->sizeof_gregset = 16 * 4;
- /* OpenBSD has a single register set. */
- set_gdbarch_regset_from_core_section
- (gdbarch, i386obsd_aout_regset_from_core_section);
-
/* OpenBSD uses -freg-struct-return by default. */
tdep->struct_return = reg_struct_return;
@@ -146,6 +144,38 @@ i386obsd_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch)
tdep->sc_reg_offset = i386obsd_sc_reg_offset;
tdep->sc_num_regs = ARRAY_SIZE (i386obsd_sc_reg_offset);
}
+
+/* OpenBSD a.out. */
+
+static void
+i386obsd_aout_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch)
+{
+ i386obsd_init_abi (info, gdbarch);
+
+ /* OpenBSD a.out has a single register set. */
+ set_gdbarch_regset_from_core_section
+ (gdbarch, i386obsd_aout_regset_from_core_section);
+}
+
+/* OpenBSD ELF. */
+
+static void
+i386obsd_elf_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch)
+{
+ struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
+
+ /* It's still OpenBSD. */
+ i386obsd_init_abi (info, gdbarch);
+
+ /* But ELF-based. */
+ i386_elf_init_abi (info, gdbarch);
+
+ /* OpenBSD ELF uses SVR4-style shared libraries. */
+ set_gdbarch_in_solib_call_trampoline
+ (gdbarch, generic_in_solib_call_trampoline);
+ set_solib_svr4_fetch_link_map_offsets
+ (gdbarch, svr4_ilp32_fetch_link_map_offsets);
+}
/* Provide a prototype to silence -Wmissing-prototypes. */
@@ -161,5 +191,7 @@ _initialize_i386obsd_tdep (void)
#define GDB_OSABI_OPENBSD_AOUT GDB_OSABI_NETBSD_AOUT
gdbarch_register_osabi (bfd_arch_i386, 0, GDB_OSABI_OPENBSD_AOUT,
- i386obsd_init_abi);
+ i386obsd_aout_init_abi);
+ gdbarch_register_osabi (bfd_arch_i386, 0, GDB_OSABI_OPENBSD_ELF,
+ i386obsd_elf_init_abi);
}