From edd06fb34aa17dbf7404b20015ace1eb9fa1d515 Mon Sep 17 00:00:00 2001 From: Mark Kettenis Date: Sun, 9 May 2010 09:34:43 +0000 Subject: Reserve space for 6 extended word argument slots required by the ABI. Apparently gcc4 uses them in cases where gcc3 didn't. Fixes segmentation faults with gcc4 because the space for the slots was colliding with the space for dl_data that we allocated on the stack. ok miod@ --- libexec/ld.so/sparc64/ldasm.S | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'libexec/ld.so/sparc64') diff --git a/libexec/ld.so/sparc64/ldasm.S b/libexec/ld.so/sparc64/ldasm.S index 7b9f8d72210..64d80185757 100644 --- a/libexec/ld.so/sparc64/ldasm.S +++ b/libexec/ld.so/sparc64/ldasm.S @@ -1,4 +1,4 @@ -/* $OpenBSD: ldasm.S,v 1.25 2010/04/24 18:12:29 kettenis Exp $ */ +/* $OpenBSD: ldasm.S,v 1.26 2010/05/09 09:34:42 kettenis Exp $ */ /* $NetBSD: rtld_start.S,v 1.5 2001/08/14 22:17:48 eeh Exp $ */ /* @@ -85,7 +85,7 @@ */ /* Offset of ARGC from bottom of stack */ -#define ARGC (16*8) +#define ARGC CC64FSZ /* XXX - DL_DATA_SIZE should be (9*8), but I can't think right now. */ #define DL_DATA_SIZE (16*8) @@ -96,7 +96,7 @@ _ENTRY(_dl_start) sub %g0, %g0, %fp ! clear frame mov %g1, %l1 ! save ps_strings - sub %sp, DL_DATA_SIZE, %sp ! make room for dl_data + sub %sp, 48 + DL_DATA_SIZE, %sp ! make room for dl_data add %sp, BIAS + ARGC, %l3 add %l3, DL_DATA_SIZE, %o0 @@ -131,7 +131,7 @@ _ENTRY(_dl_start) call _dl_boot ! _dl_boot(argv,envp,loff,dl_data) nop - add %sp, DL_DATA_SIZE, %sp ! restore stack + add %sp, 48 + DL_DATA_SIZE, %sp ! restore stack mov %l1, %g1 ! restore ps_strings jmp %o0 -- cgit v1.2.3