Skip to content

Commit 6c3b5a2

Browse files
committed
runtime: correct vdsoSP on S390X
It should get the caller's SP. The current code gets the address of the first parameter, which is one word above the caller's SP. There is a slot for saving the LR at 0(SP) in the caller's frame. Fixes #62086 (for s390x). Change-Id: Ie8cbfabc8161b98658c884a32e0af72df189ea56 Reviewed-on: https://go-review.googlesource.com/c/go/+/685715 Reviewed-by: David Chase <drchase@google.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
1 parent dd687c3 commit 6c3b5a2

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

‎src/runtime/sys_linux_s390x.s

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,7 @@ TEXT runtime·walltime(SB),NOSPLIT,$32-12
226226
MOVD R4, 24(R15)
227227

228228
MOVD R14, R8 // Backup return address
229-
MOVD $sec+0(FP), R4 // return parameter caller
229+
MOVD $ret-8(FP), R4 // caller's SP
230230

231231
MOVD R8, m_vdsoPC(R6)
232232
MOVD R4, m_vdsoSP(R6)
@@ -312,7 +312,7 @@ TEXT runtime·nanotime1(SB),NOSPLIT,$32-8
312312
MOVD R4, 24(R15)
313313

314314
MOVD R14, R8 // Backup return address
315-
MOVD $ret+0(FP), R4 // caller's SP
315+
MOVD $ret-8(FP), R4 // caller's SP
316316

317317
MOVD R8, m_vdsoPC(R6)
318318
MOVD R4, m_vdsoSP(R6)

0 commit comments

Comments
 (0)