]> git.ipfire.org Git - thirdparty/qemu.git/commit
common-user/host/riscv: use tail pseudoinstruction for calling tail
authorIcenowy Zheng <uwu@icenowy.me>
Thu, 17 Apr 2025 07:22:06 +0000 (15:22 +0800)
committerMichael Tokarev <mjt@tls.msk.ru>
Tue, 20 May 2025 06:56:01 +0000 (09:56 +0300)
commitfb1f88ee29fedf649d4422db241d03986d1f1df8
treecf913c90cd8806e1adb45a8906e86383827cf983
parent82c0f4946a2b88dcbe976e673e826bab7d94f6a3
common-user/host/riscv: use tail pseudoinstruction for calling tail

The j pseudoinstruction maps to a JAL instruction, which can only handle
a jump to somewhere with a signed 20-bit destination. In case of static
linking and LTO'ing this easily leads to "relocation truncated to fit"
error.

Switch to use tail pseudoinstruction, which is the standard way to
tail-call a function in medium code model (emits AUIPC+JALR).

Signed-off-by: Icenowy Zheng <uwu@icenowy.me>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-ID: <20250417072206.364008-1-uwu@icenowy.me>
Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
Cc: qemu-stable@nongnu.org
(cherry picked from commit 22b448ccc6611a59d4aa54419f4d88c1f343cb35)
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
common-user/host/riscv/safe-syscall.inc.S