__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 <l.stelmach@samsung.com>
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
ret
-99: j __syscall_error
+99: tail __syscall_error
PSEUDO_END (__getcontext)
jr t1
-99: j __syscall_error
+99: tail __syscall_error
END (__setcontext)
libc_hidden_def (__setcontext)
jr t1
-99: j __syscall_error
+99: tail __syscall_error
PSEUDO_END (__swapcontext)
# else
# define SYSCALL_ERROR_HANDLER(name) \
.Lsyscall_error ## name: \
- j __syscall_error;
+ tail __syscall_error;
# endif
/* Performs a system call, not setting errno. */
bltz a0, 1f
ret
-1: j __syscall_error
+1: tail __syscall_error
END (__libc_vfork)
weak_alias (__libc_vfork, vfork)