linux-user: fix alpha signal emulation
authorLaurent Vivier <laurent@vivier.eu>
Sun, 1 Apr 2018 20:46:53 +0000 (22:46 +0200)
committerLaurent Vivier <laurent@vivier.eu>
Tue, 3 Apr 2018 09:49:49 +0000 (11:49 +0200)
setup_frame() doesn't set correctly the address of the trampoline code.
The offset of retcode array must be added to the stack frame address.

Signed-off-by: Laurent Vivier <laurent@vivier.eu>
Message-Id: <20180401204653.14211-1-laurent@vivier.eu>

linux-user/signal.c

index 2ea3e0321f4d042aa2427304681dc66aaffe4d4c..9399f0ec470fc5b34458eb03796b10737be44dfc 100644 (file)
@@ -6367,7 +6367,7 @@ static void setup_frame(int sig, struct target_sigaction *ka,
                    &frame->retcode[1]);
         __put_user(INSN_CALLSYS, &frame->retcode[2]);
         /* imb() */
-        r26 = frame_addr;
+        r26 = frame_addr + offsetof(struct target_sigframe, retcode);
     }
 
     unlock_user_struct(frame, frame_addr, 1);
@@ -6424,7 +6424,7 @@ static void setup_rt_frame(int sig, struct target_sigaction *ka,
                    &frame->retcode[1]);
         __put_user(INSN_CALLSYS, &frame->retcode[2]);
         /* imb(); */
-        r26 = frame_addr;
+        r26 = frame_addr + offsetof(struct target_sigframe, retcode);
     }
 
     if (err) {