Mark the lr register as undefined at the start of execution, so unwind
will stop at this frame. run-backtrace-*.sh from elfutils testsuite will
fail without this patch.
* sysdeps/csky/abiv2/start.S: Mark lr as undefined.
* sysdeps/unix/sysv/linux/csky/abiv2/clone.S: Likewise.
* sysdeps/unix/sysv/linux/csky/abiv2/setcontext.S: Likewise.
+2019-03-11 Mao Han <han_mao@c-sky.com>
+
+ * sysdeps/csky/abiv2/start.S: Mark lr as undefined.
+ * sysdeps/unix/sysv/linux/csky/abiv2/clone.S: Likewise.
+ * sysdeps/unix/sysv/linux/csky/abiv2/setcontext.S: Likewise.
+
2019-03-11 Mao Han <han_mao@c-sky.com>
* sysdeps/unix/sysv/linux/csky/sys/procfs.h: Use linux definition
.type _start,@function;
.align 4;
_start:
+ cfi_startproc
+ .cfi_label .Ldummy
+ cfi_undefined (lr)
subi sp, 8
/* Clear the link register since this is the outermost frame. */
movi lr, 0
/* Should never get here. */
jsri abort
#endif /* !SHARED */
+ cfi_endproc
.size _start,.-_start
btsti a0, 31 /* Check if return is less than zero. */
bt __do_syscall_error
cmpnei a0, 0
- bf __child
+ bf __thread_start
rts
__error_arg:
rts
PSEUDO_END (__clone)
-__child:
+ENTRY (__thread_start)
+ .cfi_label .Ldummy
+ cfi_undefined (lr)
ldw a0, (sp, 4) /* Restore args from new sp. */
ldw a1, (sp, 0) /* Restore function from new sp. */
addi sp, 8
/* exit */
lrw r7, __NR_exit
trap 0
+END (__thread_start)
libc_hidden_def (__clone)
weak_alias (__clone, clone)
weak_alias (__setcontext, setcontext)
ENTRY (__startcontext)
+ .cfi_label .Ldummy
+ cfi_undefined (lr)
mov a0, r9
cmpnei r9, 0 /* r9 was set in makecontext. */
bf 1f /* null, then exit. */