@@ -37,11 +37,16 @@
st.a r7, [sp, -4]
st.a r8, [sp, -4]
st.a r9, [sp, -4]
+ cfi_adjust_cfa_offset (40)
push_s blink
+ cfi_adjust_cfa_offset (4)
+ cfi_rel_offset (blink, 0)
.endm
.macro RESTORE_CALLER_SAVED_BUT_R0
ld.ab blink,[sp, 4]
+ cfi_adjust_cfa_offset (-4)
+ cfi_restore (blink)
ld.ab r9, [sp, 4]
ld.ab r8, [sp, 4]
ld.ab r7, [sp, 4]
@@ -51,6 +56,7 @@
pop_s r3
pop_s r2
pop_s r1
+ cfi_adjust_cfa_offset (-36)
.endm
; Upon entry, PLTn, which led us here, sets up the following regs
@@ -69,4 +75,7 @@ ENTRY(_dl_runtime_resolve)
RESTORE_CALLER_SAVED_BUT_R0
j_s.d [r0] ; r0 has resolved function addr
pop_s r0 ; restore first arg to resolved call
+ cfi_adjust_cfa_offset (-4)
+ cfi_restore (r0)
+
END(_dl_runtime_resolve)
@@ -32,10 +32,12 @@
.globl C_SYMBOL_NAME(name) ASM_LINE_SEP \
.type C_SYMBOL_NAME(name),%function ASM_LINE_SEP \
C_LABEL(name) ASM_LINE_SEP \
+ cfi_startproc ASM_LINE_SEP \
CALL_MCOUNT
#undef END
#define END(name) \
+ cfi_endproc ASM_LINE_SEP \
ASM_SIZE_DIRECTIVE(name)
#ifdef SHARED
@@ -26,7 +26,12 @@
*/
static void __default_rt_sa_restorer(void)
{
- INTERNAL_SYSCALL_NCS(__NR_rt_sigreturn, , 0);
+ /* Don't use INTERNAL_SYSCALL_NCS as it causes blink to be spilled on stack */
+ asm volatile(
+ "mov r8, %0 \n\t" \
+ ARC_TRAP_INSN \
+ :
+ : "r"(__NR_rt_sigreturn));
}
#define SA_RESTORER 0x04000000
@@ -83,10 +83,14 @@
.macro PUSH reg
st.a \reg, [sp, -4]
+ cfi_adjust_cfa_offset (4)
+ cfi_rel_offset (\reg, 0)
.endm
.macro POP reg
ld.ab \reg, [sp, 4]
+ cfi_adjust_cfa_offset (-4)
+ cfi_restore (\reg)
.endm
#define DOCARGS_0 PUSH blink
@@ -103,8 +103,12 @@
# define SYSCALL_ERROR_HANDLER \
0: ASM_LINE_SEP \
st.a blink, [sp, -4] ASM_LINE_SEP \
+ cfi_adjust_cfa_offset (4) ASM_LINE_SEP \
+ cfi_rel_offset (blink, 0) ASM_LINE_SEP \
CALL_ERRNO_SETTER_C ASM_LINE_SEP \
ld.ab blink, [sp, 4] ASM_LINE_SEP \
+ cfi_adjust_cfa_offset (-4) ASM_LINE_SEP \
+ cfi_restore (blink) ASM_LINE_SEP \
j [blink]
# define DO_CALL(syscall_name, args) \
@@ -137,13 +141,13 @@ hidden_proto (__syscall_error)
__res = INTERNAL_SYSCALL_NCS(__NR_##name, , nr_args, args); \
if (__builtin_expect (INTERNAL_SYSCALL_ERROR_P ((__res), ), 0)) \
{ \
- asm volatile ("st.a blink, [sp, -4] \n\t" \
+ asm volatile ( \
CALL_ERRNO_SETTER \
- "ld.ab blink, [sp, 4] \n\t" \
:"+r" (__res) \
: \
:"r1","r2","r3","r4","r5","r6", \
- "r7","r8","r9","r10","r11","r12"); \
+ "r7","r8","r9","r10","r11","r12", \
+ "blink"); \
} \
__res; \
})
@@ -174,7 +178,7 @@ hidden_proto (__syscall_error)
ARC_TRAP_INSN \
: "+r" (__ret) \
: "r"(_sys_num) ASM_ARGS_##nr_args \
- : "memory"); \
+ : "memory", "blink"); \
\
__ret; \
})