From c7413837aac7837d9fea9cf3f3b89f115d172a82 Mon Sep 17 00:00:00 2001 From: Ayke van Laethem Date: Mon, 27 Sep 2021 19:26:11 +0200 Subject: [PATCH] riscv: align the heap to 16 bytes This may be expected by the ABI. In particular, it means that stacks allocated on the heap will be 16-byte aligned. --- targets/riscv.ld | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/targets/riscv.ld b/targets/riscv.ld index 2b9f5027..eecac6b4 100644 --- a/targets/riscv.ld +++ b/targets/riscv.ld @@ -58,7 +58,7 @@ SECTIONS } /* For the memory allocator. */ -_heap_start = _ebss; +_heap_start = ALIGN(_ebss, 16); _heap_end = ORIGIN(RAM) + LENGTH(RAM); _globals_start = _sdata; _globals_end = _ebss;