aboutsummaryrefslogtreecommitdiff
path: root/src/runtime/signal_linux_ppc64x.go
diff options
context:
space:
mode:
authorMichael Hudson-Doyle <michael.hudson@canonical.com>2015-12-01 14:47:22 +1300
committerMichael Hudson-Doyle <michael.hudson@canonical.com>2015-12-01 04:51:35 +0000
commitf000523018e80471f51e29cae117831157d8dfb8 (patch)
treea952e6f0303cc4bb8730fcf5010681e8a3768996 /src/runtime/signal_linux_ppc64x.go
parent7305b55e98a6ff747491f39e72bfd1195f1161da (diff)
downloadgo-f000523018e80471f51e29cae117831157d8dfb8.tar.gz
go-f000523018e80471f51e29cae117831157d8dfb8.zip
runtime: set r12 to sigpanic before jumping to it in sighandler
The ppc64le shared library ABI demands that r12 is set to a function's global entrypoint before jumping to the global entrypoint. Not doing so means that handling signals that usually panic actually crashes (and so, e.g. can't be recovered). Fixes several failures of "cd test; go run run.go -linkshared". Change-Id: Ia4d0da4c13efda68340d38c045a52b37c2f90796 Reviewed-on: https://go-review.googlesource.com/17280 Reviewed-by: Ian Lance Taylor <iant@golang.org>
Diffstat (limited to 'src/runtime/signal_linux_ppc64x.go')
-rw-r--r--src/runtime/signal_linux_ppc64x.go1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/runtime/signal_linux_ppc64x.go b/src/runtime/signal_linux_ppc64x.go
index 5445201b19..49e97a4d25 100644
--- a/src/runtime/signal_linux_ppc64x.go
+++ b/src/runtime/signal_linux_ppc64x.go
@@ -63,6 +63,7 @@ func (c *sigctxt) sigaddr() uint64 { return c.info.si_addr }
func (c *sigctxt) fault() uint64 { return c.regs().dar }
func (c *sigctxt) set_r0(x uint64) { c.regs().gpr[0] = x }
+func (c *sigctxt) set_r12(x uint64) { c.regs().gpr[12] = x }
func (c *sigctxt) set_r30(x uint64) { c.regs().gpr[30] = x }
func (c *sigctxt) set_pc(x uint64) { c.regs().nip = x }
func (c *sigctxt) set_sp(x uint64) { c.regs().gpr[1] = x }