aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sim/riscv/sim-main.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/sim/riscv/sim-main.c b/sim/riscv/sim-main.c
index ddc7e1d..1ccae45 100644
--- a/sim/riscv/sim-main.c
+++ b/sim/riscv/sim-main.c
@@ -1575,6 +1575,8 @@ initialize_env (SIM_DESC sd, const char * const *argv, const char * const *env)
sp = sp_flat - ((argc + 1 + envc + 1) * sizeof (address_word));
/* Then the argc. */
sp -= sizeof (unsigned_word);
+ /* Align to 16 bytes. */
+ sp = align_down (sp, 16);
/* Set up the regs the libgloss crt0 expects. */
riscv_cpu->a0 = argc;