From cc08d9232c4875a11b9e2a8097e069467d79f31f Mon Sep 17 00:00:00 2001 From: Russ Cox Date: Wed, 16 Apr 2014 17:11:44 -0400 Subject: liblink: add leaf bit to object file format Without the leaf bit, the linker cannot record the correct frame size in the symbol table, and then stack traces get mangled. (Only for ARM.) Fixes #7338. Fixes #7347. LGTM=iant R=iant CC=golang-codereviews https://golang.org/cl/88550043 --- src/pkg/debug/goobj/read.go | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/pkg/debug') diff --git a/src/pkg/debug/goobj/read.go b/src/pkg/debug/goobj/read.go index 8882eae534..c2e6fa0927 100644 --- a/src/pkg/debug/goobj/read.go +++ b/src/pkg/debug/goobj/read.go @@ -190,6 +190,7 @@ type Var struct { type Func struct { Args int // size in bytes of of argument frame: inputs and outputs Frame int // size in bytes of local variable frame + Leaf bool // function omits save of link register (ARM) Var []Var // detail about local variables PCSP Data // PC → SP offset map PCFile Data // PC → file number map (index into File) @@ -621,6 +622,7 @@ func (r *objReader) parseObject(prefix []byte) error { s.Func = f f.Args = r.readInt() f.Frame = r.readInt() + f.Leaf = r.readInt() != 0 f.Var = make([]Var, r.readInt()) for i := range f.Var { v := &f.Var[i] -- cgit v1.3