From b6a9b5e279123f16569e0fd9f8ff14ff04bed7a3 Mon Sep 17 00:00:00 2001 From: Bobby Bingham Date: Fri, 5 Apr 2019 13:32:03 -0500 Subject: [PATCH] ppc32: fix stack alignment The stack should be 16-byte aligned, not 8 mod 16. --- arch/ppc/makecontext.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/ppc/makecontext.c b/arch/ppc/makecontext.c index c562ea5..1b9efdf 100644 --- a/arch/ppc/makecontext.c +++ b/arch/ppc/makecontext.c @@ -37,7 +37,7 @@ __makecontext(ucontext_t *ucp, void (*func)(void), int argc, ...) sp = (greg_t *) ((uintptr_t) ucp->uc_stack.ss_sp + ucp->uc_stack.ss_size); sp -= (uc_link + 1); - sp = (greg_t *) (((uintptr_t) sp & -16L) - 8); + sp = (greg_t *) ((uintptr_t) sp & -16L); ucp->uc_mcontext.gregs[REG_NIP] = (uintptr_t) func; ucp->uc_mcontext.gregs[REG_LNK] = (uintptr_t) &__start_context;