From f404cb60b882bfe439f9346e5849bf6bf2ec3656 Mon Sep 17 00:00:00 2001 From: Ville Juven Date: Fri, 8 Dec 2023 12:28:39 +0200 Subject: [PATCH] mpfs_head.S: Change j/jal to tail call In order to avoid linker truncation error (address unreachable), making it a tail call ensures this does not happen. --- arch/risc-v/src/mpfs/mpfs_head.S | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/risc-v/src/mpfs/mpfs_head.S b/arch/risc-v/src/mpfs/mpfs_head.S index 50dd270922..ec2c3d3a04 100644 --- a/arch/risc-v/src/mpfs/mpfs_head.S +++ b/arch/risc-v/src/mpfs/mpfs_head.S @@ -166,7 +166,7 @@ __start: csrw mip, zero /* Jump to application */ - j mpfs_jump_to_app + tail mpfs_jump_to_app .continue_boot: @@ -187,7 +187,7 @@ __start: /* Jump to __mpfs_start with mhartid in a0 */ - jal __mpfs_start + tail __mpfs_start /* We shouldn't return from __mpfs_start * in case of return, loop forever. nop's added so can be seen in debugger