From 07f16a905d18f1cd138abc999c10c0cbf62a72cc Mon Sep 17 00:00:00 2001 From: nwhitehorn Date: Sat, 7 Apr 2012 22:28:50 +0000 Subject: Properly resolve the _ctx_start function descriptor (the symbol _ctx_start is a descriptor, not a code address), which prevents crashes when starting a context. This fixes QEMU on powerpc64. MFC after: 3 days --- lib/libc/powerpc64/gen/makecontext.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/libc/powerpc64') diff --git a/lib/libc/powerpc64/gen/makecontext.c b/lib/libc/powerpc64/gen/makecontext.c index 6d980f3..b01c5c1 100644 --- a/lib/libc/powerpc64/gen/makecontext.c +++ b/lib/libc/powerpc64/gen/makecontext.c @@ -111,7 +111,7 @@ __makecontext(ucontext_t *ucp, void (*start)(void), int argc, ...) * Use caller-saved regs 14/15 to hold params that _ctx_start * will use to invoke the user-supplied func */ - mc->mc_srr0 = (uintptr_t) _ctx_start; + mc->mc_srr0 = *(uintptr_t *)_ctx_start; mc->mc_gpr[1] = (uintptr_t) sp; /* new stack pointer */ mc->mc_gpr[14] = (uintptr_t) start; /* r14 <- start */ mc->mc_gpr[15] = (uintptr_t) ucp; /* r15 <- ucp */ -- cgit v1.1