diff options
author | Mao Han <han_mao@c-sky.com> | 2019-03-11 09:51:14 +0800 |
---|---|---|
committer | Mao Han <han_mao@c-sky.com> | 2019-03-11 09:51:14 +0800 |
commit | c4e5f34bf0d818be747edf9a30e4152953cc6706 (patch) | |
tree | 5a949262e0659412ca4398ac4be1af56fe59207b /sysdeps/unix | |
parent | 827e30f3a31ee294eb23dc572f8af62158049257 (diff) | |
download | glibc-c4e5f34bf0d818be747edf9a30e4152953cc6706.tar.gz glibc-c4e5f34bf0d818be747edf9a30e4152953cc6706.tar.xz glibc-c4e5f34bf0d818be747edf9a30e4152953cc6706.zip |
C-SKY: mark lr as undefined to stop unwinding
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.
Diffstat (limited to 'sysdeps/unix')
-rw-r--r-- | sysdeps/unix/sysv/linux/csky/abiv2/clone.S | 7 | ||||
-rw-r--r-- | sysdeps/unix/sysv/linux/csky/abiv2/setcontext.S | 2 |
2 files changed, 7 insertions, 2 deletions
diff --git a/sysdeps/unix/sysv/linux/csky/abiv2/clone.S b/sysdeps/unix/sysv/linux/csky/abiv2/clone.S index 3e7328a65a..c1352ee4d7 100644 --- a/sysdeps/unix/sysv/linux/csky/abiv2/clone.S +++ b/sysdeps/unix/sysv/linux/csky/abiv2/clone.S @@ -54,7 +54,7 @@ ENTRY (__clone) 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: @@ -81,7 +81,9 @@ __do_syscall_error: 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 @@ -90,6 +92,7 @@ __child: /* exit */ lrw r7, __NR_exit trap 0 +END (__thread_start) libc_hidden_def (__clone) weak_alias (__clone, clone) diff --git a/sysdeps/unix/sysv/linux/csky/abiv2/setcontext.S b/sysdeps/unix/sysv/linux/csky/abiv2/setcontext.S index 6d3f04f9f0..34de6e3ab4 100644 --- a/sysdeps/unix/sysv/linux/csky/abiv2/setcontext.S +++ b/sysdeps/unix/sysv/linux/csky/abiv2/setcontext.S @@ -62,6 +62,8 @@ END (setcontext) 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. */ |