From 5e5285b1e7751327ad7fb1b5441a5128d92a54ec Mon Sep 17 00:00:00 2001 From: Miod Vallat Date: Sat, 22 Feb 2014 18:10:40 +0000 Subject: Increase _STACKALIGNBYTES to 15 (was 7), and make sure the stack is aligned to a 16 byte boundary in csu (similar to what the other arches where _STACKALIGNBYTES != _ALIGNBYTES do). This is necessary for long double variables on the stack to be correctly aligned. --- lib/csu/mips64/md_init.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'lib/csu') diff --git a/lib/csu/mips64/md_init.h b/lib/csu/mips64/md_init.h index 66c7c7fa7dc..d57144bc878 100644 --- a/lib/csu/mips64/md_init.h +++ b/lib/csu/mips64/md_init.h @@ -1,4 +1,4 @@ -/* $OpenBSD: md_init.h,v 1.5 2013/12/23 18:16:39 kettenis Exp $ */ +/* $OpenBSD: md_init.h,v 1.6 2014/02/22 18:10:39 miod Exp $ */ /*- * Copyright (c) 2001 Ross Harvey @@ -99,6 +99,8 @@ " addiu $gp, $gp, %lo(%neg(%gp_rel(__start))) \n" \ " daddu $gp, $gp, $t9 \n" \ " move $a0, $sp \n" \ + " dsrl $a1, $sp, 4 \n" /* align stack on a */ \ + " dsll $sp, $a1, 4 \n" /* 16 byte boundary */ \ " move $a1, $v0 \n" \ " dla $t9, ___start \n" \ " jr $t9 \n" \ -- cgit v1.2.3