$OpenBSD: patch-gdb_amd64obsd-tdep_c,v 1.1 2011/12/22 20:27:32 pascal Exp $
--- gdb/amd64obsd-tdep.c.orig	Thu Dec 22 18:17:24 2011
+++ gdb/amd64obsd-tdep.c	Thu Dec 22 18:17:24 2011
@@ -456,9 +456,6 @@ amd64obsd_init_abi (struct gdbarch_info info, struct g
   tdep->gregset_num_regs = ARRAY_SIZE (amd64obsd_r_reg_offset);
   tdep->sizeof_gregset = 24 * 8;
 
-  set_gdbarch_regset_from_core_section (gdbarch,
-					amd64obsd_regset_from_core_section);
-
   tdep->jb_pc_offset = 7 * 8;
 
   tdep->sigtramp_p = amd64obsd_sigtramp_p;
@@ -479,6 +476,17 @@ amd64obsd_init_abi (struct gdbarch_info info, struct g
 }
 
 
+/* Traditional (a.out) NetBSD-style core dumps.  */
+
+static void
+amd64obsd_core_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch)
+{
+  amd64obsd_init_abi (info, gdbarch);
+
+  set_gdbarch_regset_from_core_section
+    (gdbarch, amd64obsd_regset_from_core_section);
+}
+
 /* Provide a prototype to silence -Wmissing-prototypes.  */
 void _initialize_amd64obsd_tdep (void);
 
@@ -493,5 +501,5 @@ _initialize_amd64obsd_tdep (void)
 
   /* OpenBSD uses traditional (a.out) NetBSD-style core dumps.  */
   gdbarch_register_osabi (bfd_arch_i386, bfd_mach_x86_64,
-			  GDB_OSABI_NETBSD_AOUT, amd64obsd_init_abi);
+			  GDB_OSABI_NETBSD_AOUT, amd64obsd_core_init_abi);
 }
