From 47a6b374e6d9f81b7ed4db0a505c688fea865ac9 Mon Sep 17 00:00:00 2001 From: Hubert Badocha Date: Thu, 12 Sep 2024 12:41:56 +0200 Subject: [PATCH] sparc: make asm PIC friendly JIRA: RTOS-664 --- arch/sparcv8leon3/jmp.S | 13 ++++++++++++- arch/sparcv8leon3/syscalls.S | 4 ++++ 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/arch/sparcv8leon3/jmp.S b/arch/sparcv8leon3/jmp.S index 3adc2d63..9917404d 100644 --- a/arch/sparcv8leon3/jmp.S +++ b/arch/sparcv8leon3/jmp.S @@ -112,8 +112,19 @@ _longjmp: .type sigsetjmp, #function sigsetjmp: cmp %o1, 0 - bne setjmp + bne 1f nop +#if __pic__ == 0 ba _setjmp +#else + jmp _setjmp +#endif + nop +1: +#if __pic__ == 0 + ba setjmp +#else + jmp setjmp +#endif nop .size sigsetjmp, .-sigsetjmp diff --git a/arch/sparcv8leon3/syscalls.S b/arch/sparcv8leon3/syscalls.S index 1a7517ba..9851e85d 100644 --- a/arch/sparcv8leon3/syscalls.S +++ b/arch/sparcv8leon3/syscalls.S @@ -37,7 +37,11 @@ sym: \ .globl vfork .type vfork, #function vfork: +#if __pic__ == 0 ba vforksvc +#else + jmp vforksvc +#endif nop .size vfork, .-vfork