Skip to content

Commit a8cd10f

Browse files
committed
runtime: add arg storage to ppc64le/linux runtime.sigprofNonGoWrapper frame
CL 475935 fixed the the ELFv2 ABI violations, but in the process created a Go ABI violation by failing to allocate stack space for arguments. Allocate this space while keeping the frame 16 byte aligned. Updates #58953 Change-Id: I9942d9a433118b391ef8cd7bcea5808695cf94d4 Reviewed-on: https://go-review.googlesource.com/c/go/+/476296 Reviewed-by: Ian Lance Taylor <[email protected]> TryBot-Result: Gopher Robot <[email protected]> Reviewed-by: Archana Ravindar <[email protected]> Run-TryBot: Paul Murphy <[email protected]> Reviewed-by: Cherry Mui <[email protected]>
1 parent 71f82df commit a8cd10f

File tree

1 file changed

+10
-9
lines changed

1 file changed

+10
-9
lines changed

src/runtime/sys_linux_ppc64x.s

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -747,22 +747,23 @@ TEXT runtime·sigprofNonGoWrapper<>(SB),NOSPLIT|NOFRAME,$0
747747
MOVW CR, R0
748748
MOVD R0, 8(R1)
749749
// Don't save a back chain pointer when calling into Go. It will be overwritten.
750-
// Go stores LR where ELF stores a back chain pointer.
751-
ADD $-(32+SAVE_ALL_REG_SIZE), R1
750+
// Go stores LR where ELF stores a back chain pointer. And, allocate 64B for
751+
// FIXED_FRAME and 24B argument space, rounded up to a 16 byte boundary.
752+
ADD $-(64+SAVE_ALL_REG_SIZE), R1
752753

753-
SAVE_GPR(32)
754-
SAVE_FPR(32+SAVE_GPR_SIZE)
755-
SAVE_VR(32+SAVE_GPR_SIZE+SAVE_FPR_SIZE, R6)
754+
SAVE_GPR(64)
755+
SAVE_FPR(64+SAVE_GPR_SIZE)
756+
SAVE_VR(64+SAVE_GPR_SIZE+SAVE_FPR_SIZE, R6)
756757

757758
MOVD $0, R0
758759
CALL runtime·sigprofNonGo<ABIInternal>(SB)
759760

760-
RESTORE_GPR(32)
761-
RESTORE_FPR(32+SAVE_GPR_SIZE)
762-
RESTORE_VR(32+SAVE_GPR_SIZE+SAVE_FPR_SIZE, R6)
761+
RESTORE_GPR(64)
762+
RESTORE_FPR(64+SAVE_GPR_SIZE)
763+
RESTORE_VR(64+SAVE_GPR_SIZE+SAVE_FPR_SIZE, R6)
763764

764765
// Clear frame, restore LR, return
765-
ADD $(32+SAVE_ALL_REG_SIZE), R1
766+
ADD $(64+SAVE_ALL_REG_SIZE), R1
766767
MOVD 16(R1), R0
767768
MOVD R0, LR
768769
MOVD 8(R1), R0

0 commit comments

Comments
 (0)