aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/csmith/start.S
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/csmith/start.S')
-rw-r--r--scripts/csmith/start.S8
1 files changed, 6 insertions, 2 deletions
diff --git a/scripts/csmith/start.S b/scripts/csmith/start.S
index 33114cc..f872a14 100644
--- a/scripts/csmith/start.S
+++ b/scripts/csmith/start.S
@@ -40,9 +40,13 @@ addi x31, zero, 0
lui sp, %hi(4*1024*1024)
addi sp, sp, %lo(4*1024*1024)
-/* push a zero on the stack */
-addi sp,sp,-4
+/* push zeros on the stack for argc and argv */
+/* (stack is aligned to 16 bytes in riscv calling convention) */
+addi sp,sp,-16
sw zero,0(sp)
+sw zero,4(sp)
+sw zero,8(sp)
+sw zero,12(sp)
/* jump to libc init */
j _ftext