From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2130) id 4B7DF3857C4B; Sat, 17 Sep 2022 03:27:52 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 4B7DF3857C4B DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1663385272; bh=B8hGtrj1UUO8Q9NMiEm/+yhI8Bl1gosBQ4Jt2a3DI/I=; h=From:To:Subject:Date:From; b=qC/pYhC1EYkDorxQcoUmo0AKqbLDZxHCCZv27HBcBmwhqvP0p9ZFlOOOPaW9UCk0M dxhtp1oOkuLB4/iMpoH3ADbRcqjPcztS2jhItJFkS9kOebtGGLWwOJJ2Lm0mwT2+Yi 2vGzpz11h8LC1kgBFG0sOIxDBOloqPlIBvElGQoU= MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="utf-8" From: DJ Delorie To: glibc-cvs@sourceware.org Subject: [glibc] RISC-V: Allow long jumps to __syscall_error X-Act-Checkin: glibc X-Git-Author: =?utf-8?q?=C5=81ukasz_Stelmach?= X-Git-Refname: refs/heads/master X-Git-Oldrev: 5652e12cce80825297c3e0666991deb10310343c X-Git-Newrev: 22c96052acf78c5f4644117bece38715fc7210cf Message-Id: <20220917032752.4B7DF3857C4B@sourceware.org> Date: Sat, 17 Sep 2022 03:27:52 +0000 (GMT) List-Id: https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=22c96052acf78c5f4644117bece38715fc7210cf commit 22c96052acf78c5f4644117bece38715fc7210cf Author: Łukasz Stelmach Date: Fri Sep 16 21:31:27 2022 +0200 RISC-V: Allow long jumps to __syscall_error __syscall_error may end up farther than 1MiB away from a caller, especially when linking statically large binaries. tail allows for 4GiB jumps and is reduced to j when a linked symbol is within range. Fixes: 36960f0c76 ("RISC-V: Linux Syscall Interface") Fixes: 7f33b09c65 ("RISC-V: Linux ABI") Signed-off-by: Łukasz Stelmach Diff: --- sysdeps/unix/sysv/linux/riscv/clone.S | 2 +- sysdeps/unix/sysv/linux/riscv/getcontext.S | 2 +- sysdeps/unix/sysv/linux/riscv/setcontext.S | 2 +- sysdeps/unix/sysv/linux/riscv/swapcontext.S | 2 +- sysdeps/unix/sysv/linux/riscv/sysdep.h | 2 +- sysdeps/unix/sysv/linux/riscv/vfork.S | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/sysdeps/unix/sysv/linux/riscv/clone.S b/sysdeps/unix/sysv/linux/riscv/clone.S index d7d2915e87..45ea8f184b 100644 --- a/sysdeps/unix/sysv/linux/riscv/clone.S +++ b/sysdeps/unix/sysv/linux/riscv/clone.S @@ -63,7 +63,7 @@ L (invalid): li a0, -EINVAL /* Something bad happened -- no child created. */ L (error): - j __syscall_error + tail __syscall_error END (__clone) /* Load up the arguments to the function. Put this block of code in diff --git a/sysdeps/unix/sysv/linux/riscv/getcontext.S b/sysdeps/unix/sysv/linux/riscv/getcontext.S index 499f70b65d..f4f828805c 100644 --- a/sysdeps/unix/sysv/linux/riscv/getcontext.S +++ b/sysdeps/unix/sysv/linux/riscv/getcontext.S @@ -70,7 +70,7 @@ LEAF (__getcontext) ret -99: j __syscall_error +99: tail __syscall_error PSEUDO_END (__getcontext) diff --git a/sysdeps/unix/sysv/linux/riscv/setcontext.S b/sysdeps/unix/sysv/linux/riscv/setcontext.S index e3bc84a2e6..1e529b900c 100644 --- a/sysdeps/unix/sysv/linux/riscv/setcontext.S +++ b/sysdeps/unix/sysv/linux/riscv/setcontext.S @@ -92,7 +92,7 @@ LEAF (__setcontext) jr t1 -99: j __syscall_error +99: tail __syscall_error END (__setcontext) libc_hidden_def (__setcontext) diff --git a/sysdeps/unix/sysv/linux/riscv/swapcontext.S b/sysdeps/unix/sysv/linux/riscv/swapcontext.S index 4da615f6d4..287ba364cd 100644 --- a/sysdeps/unix/sysv/linux/riscv/swapcontext.S +++ b/sysdeps/unix/sysv/linux/riscv/swapcontext.S @@ -118,7 +118,7 @@ LEAF (__swapcontext) jr t1 -99: j __syscall_error +99: tail __syscall_error PSEUDO_END (__swapcontext) diff --git a/sysdeps/unix/sysv/linux/riscv/sysdep.h b/sysdeps/unix/sysv/linux/riscv/sysdep.h index 37ff07a0d7..9b03b10567 100644 --- a/sysdeps/unix/sysv/linux/riscv/sysdep.h +++ b/sysdeps/unix/sysv/linux/riscv/sysdep.h @@ -102,7 +102,7 @@ # else # define SYSCALL_ERROR_HANDLER(name) \ .Lsyscall_error ## name: \ - j __syscall_error; + tail __syscall_error; # endif /* Performs a system call, not setting errno. */ diff --git a/sysdeps/unix/sysv/linux/riscv/vfork.S b/sysdeps/unix/sysv/linux/riscv/vfork.S index 0970543619..1482406e2d 100644 --- a/sysdeps/unix/sysv/linux/riscv/vfork.S +++ b/sysdeps/unix/sysv/linux/riscv/vfork.S @@ -39,7 +39,7 @@ LEAF (__libc_vfork) bltz a0, 1f ret -1: j __syscall_error +1: tail __syscall_error END (__libc_vfork) weak_alias (__libc_vfork, vfork)