diff options
author | Michael Hudson-Doyle <michael.hudson@canonical.com> | 2015-10-08 22:49:39 +1300 |
---|---|---|
committer | Michael Hudson-Doyle <michael.hudson@canonical.com> | 2015-10-18 23:36:39 +0000 |
commit | 6deb3c0619240c5b2f5d28e1f038eee6ac942318 (patch) | |
tree | cb43064233cae8d33c16bb1ac18b7e277df2c2da /src/runtime/sys_linux_ppc64x.s | |
parent | b8f8969fbd91e8c6a1a6e523be91a99f92d0f809 (diff) | |
download | go-6deb3c0619240c5b2f5d28e1f038eee6ac942318.tar.gz go-6deb3c0619240c5b2f5d28e1f038eee6ac942318.zip |
runtime, runtime/cgo: conform to PIC register use rules in ppc64 asm
PIC code on ppc64le uses R2 as a TOC pointer and when calling a function
through a function pointer must ensure the function pointer is in R12. These
rules are easy enough to follow unconditionally in our assembly, so do that.
Change-Id: Icfc4e47ae5dfbe15f581cbdd785cdeed6e40bc32
Reviewed-on: https://go-review.googlesource.com/15526
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Diffstat (limited to 'src/runtime/sys_linux_ppc64x.s')
-rw-r--r-- | src/runtime/sys_linux_ppc64x.s | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/runtime/sys_linux_ppc64x.s b/src/runtime/sys_linux_ppc64x.s index ee15beeb3a..b334a03038 100644 --- a/src/runtime/sys_linux_ppc64x.s +++ b/src/runtime/sys_linux_ppc64x.s @@ -206,8 +206,8 @@ TEXT runtime·sigfwd(SB),NOSPLIT,$0-32 MOVW sig+8(FP), R3 MOVD info+16(FP), R4 MOVD ctx+24(FP), R5 - MOVD fn+0(FP), R31 - MOVD R31, CTR + MOVD fn+0(FP), R12 + MOVD R12, CTR BL (CTR) RET @@ -235,8 +235,8 @@ TEXT runtime·_sigtramp(SB),NOSPLIT,$64 MOVW R3, FIXED_FRAME+0(R1) MOVD R4, FIXED_FRAME+8(R1) MOVD R5, FIXED_FRAME+16(R1) - MOVD $runtime·sigtrampgo(SB), R31 - MOVD R31, CTR + MOVD $runtime·sigtrampgo(SB), R12 + MOVD R12, CTR BL (CTR) RET |