From: Matt Turner <[email protected]>
The unwinder looks up a return address as IP - 1 (hence the nop before
sigreturn_region_start). For a frame returning to __kernel_rt_sigreturn
that is the last byte of __kernel_sigreturn, which still has the
sigreturn CFA, so the rt_sigreturn frame is unwound with the wrong
sigcontext offset. _Unwind_Backtrace() from an SA_SIGINFO handler stops
after three frames.
Add a nop after .cfi_def_cfa_offset, as linux-user/i386/vdso.S does.
Fixes: 975bd51a88 ("linux-user/sh4: add VDSO support for sh4 and sh4eb")
Cc: [email protected]
Signed-off-by: Matt Turner <[email protected]>
Reviewed-by: Helge Deller <[email protected]>
Signed-off-by: Helge Deller <[email protected]>
(cherry picked from commit 5c98e72e6aae3e538ef8276e8d7f30d33af6d6bb)
Signed-off-by: Michael Tokarev <[email protected]>
diff --git a/linux-user/sh4/vdso-be.so b/linux-user/sh4/vdso-be.so
index bc1fb37e108..df9fa22efab 100755
Binary files a/linux-user/sh4/vdso-be.so and b/linux-user/sh4/vdso-be.so differ
diff --git a/linux-user/sh4/vdso-le.so b/linux-user/sh4/vdso-le.so
index c1ff560cc16..decd6742022 100755
Binary files a/linux-user/sh4/vdso-le.so and b/linux-user/sh4/vdso-le.so differ
diff --git a/linux-user/sh4/vdso.S b/linux-user/sh4/vdso.S
index 1faa6657746..290eb498aeb 100644
--- a/linux-user/sh4/vdso.S
+++ b/linux-user/sh4/vdso.S
@@ -141,8 +141,9 @@ __kernel_sigreturn:
sigreturn_tramp __NR_sigreturn
endf __kernel_sigreturn
- /* Update CFA base for the rt_sigreturn frame layout. */
+ /* rt_sigreturn frame layout; nop for the same reason as above. */
.cfi_def_cfa_offset RT_SIGFRAME_SC_OFFSET
+ nop
__kernel_rt_sigreturn:
sigreturn_tramp __NR_rt_sigreturn
--
2.47.3