From 1f6e7696bf953b37f0fe038da6afbd4095159623 Mon Sep 17 00:00:00 2001 From: miod Date: Mon, 1 Jun 2015 19:55:20 +0000 Subject: [PATCH] In the lazy binding routine, make sure we actually allocate the stack we need, instead of corrupting the caller's stack by mistake. This fixes the mysterious segfaults in __powerpc_read_tcb() reported on earlier G3 systems - more recent processors have been luckier... ok deraadt@ --- libexec/ld.so/powerpc/ldasm.S | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/libexec/ld.so/powerpc/ldasm.S b/libexec/ld.so/powerpc/ldasm.S index 478c1d92908..e8515cf94c0 100644 --- a/libexec/ld.so/powerpc/ldasm.S +++ b/libexec/ld.so/powerpc/ldasm.S @@ -1,4 +1,4 @@ -/* $OpenBSD: ldasm.S,v 1.21 2014/07/14 03:54:51 deraadt Exp $ */ +/* $OpenBSD: ldasm.S,v 1.22 2015/06/01 19:55:20 miod Exp $ */ /* * Copyright (c) 1999 Dale Rahn @@ -126,7 +126,7 @@ ENTRY(_dl_start) bctr # Go execute the 'real' program. ENTRY(_dl_bind_start) - stwu 1,-64(1) + stwu 1,-72(1) stw 0,8(1) # save r0 - cerror ;-) mflr 0 @@ -159,7 +159,7 @@ ENTRY(_dl_bind_start) mtlr 0 lwz 0,8(1) - addi 1,1,64 + addi 1,1,72 bctr #define DL_SYSCALL(n) DL_SYSCALL2(n,n) -- 2.20.1