diff mbox

[PULL,v2,36/38] linux-user/signal.c: Use target address instead of host address for microblaze restorer

Message ID 166c97edd682878943f496f1a3cbed49e096d43b.1464353863.git.riku.voipio@linaro.org (mailing list archive)
State New, archived
Headers show

Commit Message

Riku Voipio May 27, 2016, 1 p.m. UTC
From: Chen Gang <chengang@emindsoft.com.cn>

The return address is in target space, so the restorer address needs to
be target space, too.

Signed-off-by: Chen Gang <gang.chen.5i5j@gmail.com>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Laurent Vivier <laurent@vivier.eu>
Signed-off-by: Riku Voipio <riku.voipio@linaro.org>
---
 linux-user/signal.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
diff mbox

Patch

diff --git a/linux-user/signal.c b/linux-user/signal.c
index a072fa6..c75fb48 100644
--- a/linux-user/signal.c
+++ b/linux-user/signal.c
@@ -3573,7 +3573,8 @@  static void setup_frame(int sig, struct target_sigaction *ka,
 
         /* Return from sighandler will jump to the tramp.
            Negative 8 offset because return is rtsd r15, 8 */
-        env->regs[15] = ((unsigned long)frame->tramp) - 8;
+        env->regs[15] = frame_addr + offsetof(struct target_signal_frame, tramp)
+                                   - 8;
     }
 
     /* Set up registers for signal handler */