Module Name:    src
Committed By:   pooka
Date:           Fri Feb 25 16:01:42 UTC 2011

Modified Files:
        src/lib/librumphijack: Makefile hijackdlsym.c

Log Message:
Ok, for reasons I can't begin to understand, the binaries I tested
yesterday on powerpc broke overnight.  Apparently adding one more
function before the call to dlsym() fixes things again.  I hope
I don't have to add another one tomorrow ....


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/lib/librumphijack/Makefile
cvs rdiff -u -r1.1 -r1.2 src/lib/librumphijack/hijackdlsym.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/lib/librumphijack/Makefile
diff -u src/lib/librumphijack/Makefile:1.7 src/lib/librumphijack/Makefile:1.8
--- src/lib/librumphijack/Makefile:1.7	Wed Feb 23 15:23:15 2011
+++ src/lib/librumphijack/Makefile	Fri Feb 25 16:01:41 2011
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.7 2011/02/23 15:23:15 pooka Exp $
+#	$NetBSD: Makefile,v 1.8 2011/02/25 16:01:41 pooka Exp $
 #
 
 LIB=		rumphijack
@@ -14,8 +14,8 @@
 
 WARNS=		4
 
-#DBG=-g
-#NOGCCERROR=1
-COPTS.hijackdlsym.c+=	-fno-optimize-sibling-calls
+# make sure the compiler doesn't get clever, since we need
+# a stack frame
+COPTS.hijackdlsym.c+=	-O0
 
 .include <bsd.lib.mk>

Index: src/lib/librumphijack/hijackdlsym.c
diff -u src/lib/librumphijack/hijackdlsym.c:1.1 src/lib/librumphijack/hijackdlsym.c:1.2
--- src/lib/librumphijack/hijackdlsym.c:1.1	Wed Feb 23 15:23:15 2011
+++ src/lib/librumphijack/hijackdlsym.c	Fri Feb 25 16:01:41 2011
@@ -1,4 +1,4 @@
-/*      $NetBSD: hijackdlsym.c,v 1.1 2011/02/23 15:23:15 pooka Exp $	*/
+/*      $NetBSD: hijackdlsym.c,v 1.2 2011/02/25 16:01:41 pooka Exp $	*/
 
 /*-
  * Copyright (c) 2011 Antti Kantee.  All Rights Reserved.
@@ -26,7 +26,7 @@
  */
 
 #include <sys/cdefs.h>
-__RCSID("$NetBSD: hijackdlsym.c,v 1.1 2011/02/23 15:23:15 pooka Exp $");
+__RCSID("$NetBSD: hijackdlsym.c,v 1.2 2011/02/25 16:01:41 pooka Exp $");
 
 #include <dlfcn.h>
 
@@ -36,12 +36,22 @@
  * This is called from librumpclient in case of LD_PRELOAD.
  * It ensures correct RTLD_NEXT.
  *
- * (note, this module is compiled with -fno-optimize-sibling-calls
- * to make sure this function is not treated as a tailcall)
+ * (note, this module is compiled with -O0 to make sure this
+ * function is not treated as a tailcall or other optimizations
+ * applied)
  */
+
+/* why is this indirection required for powerpc ???? */
+static void * __noinline
+bouncer(void *handle, const char *symbol)
+{
+
+	return dlsym(handle, symbol);
+}
+
 void *
 rumphijack_dlsym(void *handle, const char *symbol)
 {
 
-	return dlsym(handle, symbol);
+	return bouncer(handle, symbol);
 }

Reply via email to