summaryrefslogtreecommitdiff
path: root/lib/csu/mips64/md_init.h
diff options
context:
space:
mode:
authorMiod Vallat <miod@cvs.openbsd.org>2014-02-22 18:10:40 +0000
committerMiod Vallat <miod@cvs.openbsd.org>2014-02-22 18:10:40 +0000
commit5e5285b1e7751327ad7fb1b5441a5128d92a54ec (patch)
tree9282cec8b38d9df166c0125d9536659b0b74e863 /lib/csu/mips64/md_init.h
parentfeb8d24cfbd4204435c30bef3baebb5a5ba4a634 (diff)
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.
Diffstat (limited to 'lib/csu/mips64/md_init.h')
-rw-r--r--lib/csu/mips64/md_init.h4
1 files changed, 3 insertions, 1 deletions
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" \