]> Cypherpunks repositories - gostls13.git/commit
[release-branch.go1.2] cmd/5l, runtime: fix divide for profiling tracebacks on ARM
authorAndrew Gerrand <adg@golang.org>
Fri, 1 Nov 2013 00:34:40 +0000 (11:34 +1100)
committerAndrew Gerrand <adg@golang.org>
Fri, 1 Nov 2013 00:34:40 +0000 (11:34 +1100)
commit4708b76f84e3d5b1e5057d50876f54972969c988
tree1a8ab5ab310473d913b0984502046bd48331a750
parent1d78c868971effacde64e9c9a8d1ae1bea13be17
[release-branch.go1.2] cmd/5l, runtime: fix divide for profiling tracebacks on ARM

««« CL 19910044 / 9eb64f5ef3a6
cmd/5l, runtime: fix divide for profiling tracebacks on ARM

Two bugs:
1. The first iteration of the traceback always uses LR when provided,
which it is (only) during a profiling signal, but in fact LR is correct
only if the stack frame has not been allocated yet. Otherwise an
intervening call may have changed LR, and the saved copy in the stack
frame should be used. Fix in traceback_arm.c.

2. The division runtime call adds 8 bytes to the stack. In order to
keep the traceback routines happy, it must copy the saved LR into
the new 0(SP). Change

        SUB $8, SP

into

        MOVW    0(SP), R11 // r11 is temporary, for use by linker
        MOVW.W  R11, -8(SP)

to update SP and 0(SP) atomically, so that the traceback always
sees a saved LR at 0(SP).

Fixes #6681.

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/19910044
»»»

R=golang-dev
CC=golang-dev
https://golang.org/cl/20170048
src/cmd/5l/noop.c
src/pkg/runtime/pprof/pprof_test.go
src/pkg/runtime/traceback_arm.c