$OpenBSD$
--- src/boehm-gc/misc.c.orig	Mon Feb 13 18:14:20 2006
+++ src/boehm-gc/misc.c	Sun Apr 30 19:38:29 2006
@@ -575,6 +575,8 @@ void GC_init_inner()
         word dummy;
 #   endif
     word initial_heap_sz = (word)MINHINCR;
+
+	GC_printf0("GC_init_inner: enter\n");
     
     if (GC_is_initialized) return;
 #   ifdef PRINTSTATS
@@ -660,7 +662,14 @@ void GC_init_inner()
 #   if defined(SEARCH_FOR_DATA_START)
 	GC_init_linux_data_start();
 #   endif
-#   if (defined(NETBSD) || defined(OPENBSD)) && defined(__ELF__)
+#   if defined(OPENBSD)
+#     if defined(__ELF__)
+	GC_init_openbsd_elf();
+#     else
+	GC_init_openbsd_aout();
+#     endif
+#   endif
+#   if defined(NETBSD) && defined(__ELF__)
 	GC_init_netbsd_elf();
 #   endif
 #   if defined(GC_PTHREADS) || defined(GC_SOLARIS_THREADS) \
@@ -801,6 +810,9 @@ void GC_init_inner()
                   GC_register_finalizer_no_order);
       }
 #   endif
+
+	GC_printf0("GC_init_inner: leave\n");
+    
 }
 
 void GC_enable_incremental GC_PROTO(())
@@ -976,9 +988,7 @@ long a, b, c, d, e, f;
     char buf[1025];
     
     if (GC_quiet) return;
-    buf[1024] = 0x15;
-    (void) sprintf(buf, format, a, b, c, d, e, f);
-    if (buf[1024] != 0x15) ABORT("GC_printf clobbered stack");
+    (void) snprintf(buf, 1025, format, a, b, c, d, e, f);
     if (WRITE(GC_stdout, buf, strlen(buf)) < 0) ABORT("write to stdout failed");
 }
 
@@ -988,9 +998,7 @@ long a, b, c, d, e, f;
 {
     char buf[1025];
     
-    buf[1024] = 0x15;
-    (void) sprintf(buf, format, a, b, c, d, e, f);
-    if (buf[1024] != 0x15) ABORT("GC_err_printf clobbered stack");
+    (void) snprintf(buf, 1025, format, a, b, c, d, e, f);
     if (WRITE(GC_stderr, buf, strlen(buf)) < 0) ABORT("write to stderr failed");
 }
 
