]> Cypherpunks.ru repositories - gostls13.git/commitdiff
internal/abi, runtime, cmd: merge funcFlag_* consts into internal/abi
authorAustin Clements <austin@google.com>
Mon, 17 Apr 2023 19:58:47 +0000 (15:58 -0400)
committerGopher Robot <gobot@golang.org>
Fri, 21 Apr 2023 19:28:46 +0000 (19:28 +0000)
For #59670.

Change-Id: Ie784ba4dd2701e4f455e1abde4a6bfebee4b1387
Reviewed-on: https://go-review.googlesource.com/c/go/+/485496
Reviewed-by: David Chase <drchase@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Run-TryBot: Austin Clements <austin@google.com>
Auto-Submit: Austin Clements <austin@google.com>

21 files changed:
src/cmd/internal/goobj/funcinfo.go
src/cmd/internal/obj/arm/obj5.go
src/cmd/internal/obj/arm64/obj7.go
src/cmd/internal/obj/link.go
src/cmd/internal/obj/loong64/obj.go
src/cmd/internal/obj/mips/obj0.go
src/cmd/internal/obj/objfile.go
src/cmd/internal/obj/plist.go
src/cmd/internal/obj/ppc64/obj9.go
src/cmd/internal/obj/riscv/obj.go
src/cmd/internal/obj/s390x/objz.go
src/cmd/internal/obj/x86/obj6.go
src/cmd/internal/objabi/funcid.go
src/cmd/link/internal/ld/pcln.go
src/cmd/link/internal/loader/loader.go
src/internal/abi/symtab.go
src/runtime/preempt.go
src/runtime/proc.go
src/runtime/runtime2.go
src/runtime/symtab.go
src/runtime/traceback.go

index 118c514460b38abb63e67265a39bae68d8c0e8c8..9aa1188b7eb50b6afd1b9a34c605608d26a94c28 100644 (file)
@@ -6,7 +6,6 @@ package goobj
 
 import (
        "bytes"
-       "cmd/internal/objabi"
        "encoding/binary"
        "internal/abi"
 )
@@ -21,7 +20,7 @@ type FuncInfo struct {
        Args      uint32
        Locals    uint32
        FuncID    abi.FuncID
-       FuncFlag  objabi.FuncFlag
+       FuncFlag  abi.FuncFlag
        StartLine int32
        File      []CUFileIndex
        InlTree   []InlTreeNode
@@ -92,7 +91,7 @@ func (*FuncInfo) ReadLocals(b []byte) uint32 { return binary.LittleEndian.Uint32
 
 func (*FuncInfo) ReadFuncID(b []byte) abi.FuncID { return abi.FuncID(b[8]) }
 
-func (*FuncInfo) ReadFuncFlag(b []byte) objabi.FuncFlag { return objabi.FuncFlag(b[9]) }
+func (*FuncInfo) ReadFuncFlag(b []byte) abi.FuncFlag { return abi.FuncFlag(b[9]) }
 
 func (*FuncInfo) ReadStartLine(b []byte) int32 { return int32(binary.LittleEndian.Uint32(b[12:])) }
 
index 38aa11cde9845e3868787cf96ced56947940e247..285fb885cb6b5ec384ccea0a83b3606c1db9a1a4 100644 (file)
@@ -34,6 +34,7 @@ import (
        "cmd/internal/obj"
        "cmd/internal/objabi"
        "cmd/internal/sys"
+       "internal/abi"
        "internal/buildcfg"
        "log"
 )
@@ -618,8 +619,8 @@ func preprocess(ctxt *obj.Link, cursym *obj.LSym, newprog obj.ProgAlloc) {
 
                if p.To.Type == obj.TYPE_REG && p.To.Reg == REGSP && p.Spadj == 0 {
                        f := c.cursym.Func()
-                       if f.FuncFlag&objabi.FuncFlag_SPWRITE == 0 {
-                               c.cursym.Func().FuncFlag |= objabi.FuncFlag_SPWRITE
+                       if f.FuncFlag&abi.FuncFlagSPWrite == 0 {
+                               c.cursym.Func().FuncFlag |= abi.FuncFlagSPWrite
                                if ctxt.Debugvlog || !ctxt.IsAsm {
                                        ctxt.Logf("auto-SPWRITE: %s %v\n", c.cursym.Name, p)
                                        if !ctxt.IsAsm {
index 6c2cb63e9b4467ed41eb4e1b4fdd45ed607e03d9..fca064a85bf176c6fedcf2ed1afa687b067244d6 100644 (file)
@@ -35,6 +35,7 @@ import (
        "cmd/internal/objabi"
        "cmd/internal/src"
        "cmd/internal/sys"
+       "internal/abi"
        "internal/buildcfg"
        "log"
        "math"
@@ -1037,8 +1038,8 @@ func preprocess(ctxt *obj.Link, cursym *obj.LSym, newprog obj.ProgAlloc) {
 
                if p.To.Type == obj.TYPE_REG && p.To.Reg == REGSP && p.Spadj == 0 {
                        f := c.cursym.Func()
-                       if f.FuncFlag&objabi.FuncFlag_SPWRITE == 0 {
-                               c.cursym.Func().FuncFlag |= objabi.FuncFlag_SPWRITE
+                       if f.FuncFlag&abi.FuncFlagSPWrite == 0 {
+                               c.cursym.Func().FuncFlag |= abi.FuncFlagSPWrite
                                if ctxt.Debugvlog || !ctxt.IsAsm {
                                        ctxt.Logf("auto-SPWRITE: %s %v\n", c.cursym.Name, p)
                                        if !ctxt.IsAsm {
index c238070d0ef0ce1364ecaa1cd34951f328842895..b50305f85c00678b072e53135cd65be16086accf 100644 (file)
@@ -478,7 +478,7 @@ type FuncInfo struct {
        Locals    int32
        Align     int32
        FuncID    abi.FuncID
-       FuncFlag  objabi.FuncFlag
+       FuncFlag  abi.FuncFlag
        StartLine int32
        Text      *Prog
        Autot     map[*LSym]struct{}
@@ -912,7 +912,7 @@ func (a Attribute) String() string {
 // TextAttrString formats the symbol attributes for printing in as part of a TEXT prog.
 func (s *LSym) TextAttrString() string {
        attr := s.Attribute.String()
-       if s.Func().FuncFlag&objabi.FuncFlag_TOPFRAME != 0 {
+       if s.Func().FuncFlag&abi.FuncFlagTopFrame != 0 {
                if attr != "" {
                        attr += "|"
                }
index 0c1f5c029da94b991ce508cdcb51ed60de4d80dd..86a0bdd01540e7b6a87f6e42bde3b8612ab1c876 100644 (file)
@@ -8,6 +8,7 @@ import (
        "cmd/internal/obj"
        "cmd/internal/objabi"
        "cmd/internal/sys"
+       "internal/abi"
        "log"
        "math"
 )
@@ -477,8 +478,8 @@ func preprocess(ctxt *obj.Link, cursym *obj.LSym, newprog obj.ProgAlloc) {
 
                if p.To.Type == obj.TYPE_REG && p.To.Reg == REGSP && p.Spadj == 0 {
                        f := c.cursym.Func()
-                       if f.FuncFlag&objabi.FuncFlag_SPWRITE == 0 {
-                               c.cursym.Func().FuncFlag |= objabi.FuncFlag_SPWRITE
+                       if f.FuncFlag&abi.FuncFlagSPWrite == 0 {
+                               c.cursym.Func().FuncFlag |= abi.FuncFlagSPWrite
                                if ctxt.Debugvlog || !ctxt.IsAsm {
                                        ctxt.Logf("auto-SPWRITE: %s %v\n", c.cursym.Name, p)
                                        if !ctxt.IsAsm {
index 9241dfd6316d078d1a2c25f8ae3b8ce33d30f64f..e8b9c31c6002aac8849f34fb9ae352b77778e0f5 100644 (file)
@@ -35,6 +35,7 @@ import (
        "cmd/internal/sys"
        "encoding/binary"
        "fmt"
+       "internal/abi"
        "log"
        "math"
 )
@@ -560,8 +561,8 @@ func preprocess(ctxt *obj.Link, cursym *obj.LSym, newprog obj.ProgAlloc) {
 
                if p.To.Type == obj.TYPE_REG && p.To.Reg == REGSP && p.Spadj == 0 {
                        f := c.cursym.Func()
-                       if f.FuncFlag&objabi.FuncFlag_SPWRITE == 0 {
-                               c.cursym.Func().FuncFlag |= objabi.FuncFlag_SPWRITE
+                       if f.FuncFlag&abi.FuncFlagSPWrite == 0 {
+                               c.cursym.Func().FuncFlag |= abi.FuncFlagSPWrite
                                if ctxt.Debugvlog || !ctxt.IsAsm {
                                        ctxt.Logf("auto-SPWRITE: %s %v\n", c.cursym.Name, p)
                                        if !ctxt.IsAsm {
index 1e9e5a827b9968c970ac8a44617a825fe51227c3..a9ddf0edf14c5907d598da5a54e6ba3a1816b4d7 100644 (file)
@@ -15,6 +15,7 @@ import (
        "cmd/internal/sys"
        "encoding/binary"
        "fmt"
+       "internal/abi"
        "io"
        "log"
        "os"
@@ -841,10 +842,10 @@ func (ctxt *Link) writeSymDebugNamed(s *LSym, name string) {
        if s.NoSplit() {
                fmt.Fprintf(ctxt.Bso, "nosplit ")
        }
-       if s.Func() != nil && s.Func().FuncFlag&objabi.FuncFlag_TOPFRAME != 0 {
+       if s.Func() != nil && s.Func().FuncFlag&abi.FuncFlagTopFrame != 0 {
                fmt.Fprintf(ctxt.Bso, "topframe ")
        }
-       if s.Func() != nil && s.Func().FuncFlag&objabi.FuncFlag_ASM != 0 {
+       if s.Func() != nil && s.Func().FuncFlag&abi.FuncFlagAsm != 0 {
                fmt.Fprintf(ctxt.Bso, "asm ")
        }
        fmt.Fprintf(ctxt.Bso, "size=%d", s.Size)
index 278ba65d9769499bc3252a091c919a37378f8d52..9ff8e425e85b9b3677832d084095605e5d7cd707 100644 (file)
@@ -8,6 +8,7 @@ import (
        "cmd/internal/objabi"
        "cmd/internal/src"
        "fmt"
+       "internal/abi"
        "strings"
 )
 
@@ -204,13 +205,13 @@ func (ctxt *Link) InitTextSym(s *LSym, flag int, start src.XPos) {
        ctxt.dwarfSym(s)
 }
 
-func (ctxt *Link) toFuncFlag(flag int) objabi.FuncFlag {
-       var out objabi.FuncFlag
+func (ctxt *Link) toFuncFlag(flag int) abi.FuncFlag {
+       var out abi.FuncFlag
        if flag&TOPFRAME != 0 {
-               out |= objabi.FuncFlag_TOPFRAME
+               out |= abi.FuncFlagTopFrame
        }
        if ctxt.IsAsm {
-               out |= objabi.FuncFlag_ASM
+               out |= abi.FuncFlagAsm
        }
        return out
 }
index e9d47b2880871998ca05a61947bfe85622af3d4c..a0ef52685517b38e40afa4fc91f776275e6bc95b 100644 (file)
@@ -34,6 +34,7 @@ import (
        "cmd/internal/objabi"
        "cmd/internal/src"
        "cmd/internal/sys"
+       "internal/abi"
        "log"
 )
 
@@ -1004,8 +1005,8 @@ func preprocess(ctxt *obj.Link, cursym *obj.LSym, newprog obj.ProgAlloc) {
 
                if p.To.Type == obj.TYPE_REG && p.To.Reg == REGSP && p.Spadj == 0 && p.As != ACMPU {
                        f := c.cursym.Func()
-                       if f.FuncFlag&objabi.FuncFlag_SPWRITE == 0 {
-                               c.cursym.Func().FuncFlag |= objabi.FuncFlag_SPWRITE
+                       if f.FuncFlag&abi.FuncFlagSPWrite == 0 {
+                               c.cursym.Func().FuncFlag |= abi.FuncFlagSPWrite
                                if ctxt.Debugvlog || !ctxt.IsAsm {
                                        ctxt.Logf("auto-SPWRITE: %s %v\n", c.cursym.Name, p)
                                        if !ctxt.IsAsm {
index 0d97121e2c0f7efa6eb2d4897430d739d91bd2a8..38ea19531d60fb931c2671504b8afed24436c756 100644 (file)
@@ -25,6 +25,7 @@ import (
        "cmd/internal/objabi"
        "cmd/internal/sys"
        "fmt"
+       "internal/abi"
        "log"
        "math/bits"
 )
@@ -592,8 +593,8 @@ func preprocess(ctxt *obj.Link, cursym *obj.LSym, newprog obj.ProgAlloc) {
 
                if p.To.Type == obj.TYPE_REG && p.To.Reg == REGSP && p.Spadj == 0 {
                        f := cursym.Func()
-                       if f.FuncFlag&objabi.FuncFlag_SPWRITE == 0 {
-                               f.FuncFlag |= objabi.FuncFlag_SPWRITE
+                       if f.FuncFlag&abi.FuncFlagSPWrite == 0 {
+                               f.FuncFlag |= abi.FuncFlagSPWrite
                                if ctxt.Debugvlog || !ctxt.IsAsm {
                                        ctxt.Logf("auto-SPWRITE: %s %v\n", cursym.Name, p)
                                        if !ctxt.IsAsm {
index 4e8475624df489d4f3c491d58fe33be79cf1b96d..3bab614af616c336c565cbc1a602c77ca3892175 100644 (file)
@@ -33,6 +33,7 @@ import (
        "cmd/internal/obj"
        "cmd/internal/objabi"
        "cmd/internal/sys"
+       "internal/abi"
        "log"
        "math"
 )
@@ -568,8 +569,8 @@ func preprocess(ctxt *obj.Link, cursym *obj.LSym, newprog obj.ProgAlloc) {
 
                if p.To.Type == obj.TYPE_REG && p.To.Reg == REGSP && p.Spadj == 0 {
                        f := c.cursym.Func()
-                       if f.FuncFlag&objabi.FuncFlag_SPWRITE == 0 {
-                               c.cursym.Func().FuncFlag |= objabi.FuncFlag_SPWRITE
+                       if f.FuncFlag&abi.FuncFlagSPWrite == 0 {
+                               c.cursym.Func().FuncFlag |= abi.FuncFlagSPWrite
                                if ctxt.Debugvlog || !ctxt.IsAsm {
                                        ctxt.Logf("auto-SPWRITE: %s\n", c.cursym.Name)
                                        if !ctxt.IsAsm {
index 8c9ea4f2a912c84b1519c3f27ca95a8e32bba246..7f202dadca131eb83a0b32a45166725ba5ec0c3d 100644 (file)
@@ -35,6 +35,7 @@ import (
        "cmd/internal/objabi"
        "cmd/internal/src"
        "cmd/internal/sys"
+       "internal/abi"
        "log"
        "math"
        "path"
@@ -867,8 +868,8 @@ func preprocess(ctxt *obj.Link, cursym *obj.LSym, newprog obj.ProgAlloc) {
                default:
                        if p.To.Type == obj.TYPE_REG && p.To.Reg == REG_SP && p.As != ACMPL && p.As != ACMPQ {
                                f := cursym.Func()
-                               if f.FuncFlag&objabi.FuncFlag_SPWRITE == 0 {
-                                       f.FuncFlag |= objabi.FuncFlag_SPWRITE
+                               if f.FuncFlag&abi.FuncFlagSPWrite == 0 {
+                                       f.FuncFlag |= abi.FuncFlagSPWrite
                                        if ctxt.Debugvlog || !ctxt.IsAsm {
                                                ctxt.Logf("auto-SPWRITE: %s %v\n", cursym.Name, p)
                                                if !ctxt.IsAsm {
index 65f605d0ffe9ab998a2d74e89e8ba4f584c2872f..afe9deb4f1b9fad4d3763706fd1487d614ee0f32 100644 (file)
@@ -9,16 +9,6 @@ import (
        "strings"
 )
 
-// A FuncFlag records bits about a function, passed to the runtime.
-type FuncFlag uint8
-
-// Note: This list must match the list in runtime/symtab.go.
-const (
-       FuncFlag_TOPFRAME = 1 << iota
-       FuncFlag_SPWRITE
-       FuncFlag_ASM
-)
-
 var funcIDs = map[string]abi.FuncID{
        "abort":              abi.FuncID_abort,
        "asmcgocall":         abi.FuncID_asmcgocall,
index 7a0425d131d3818906946afced3561c61bc1f996..13e8cd33da32aabfecef50c9c512d1db8363eb17 100644 (file)
@@ -706,7 +706,7 @@ func writeFuncs(ctxt *Link, sb *loader.SymbolBuilder, funcs []loader.Sym, inlSym
                off = sb.SetUint8(ctxt.Arch, off, uint8(funcID))
 
                // flag uint8
-               var flag objabi.FuncFlag
+               var flag abi.FuncFlag
                if fi.Valid() {
                        flag = fi.FuncFlag()
                }
index e72c89f38e238dc6bd46318e141ee0c184f3a818..c94f597a0f7f268e06dcbdac944a9c747cbd2871 100644 (file)
@@ -1995,7 +1995,7 @@ func (fi *FuncInfo) FuncID() abi.FuncID {
        return (*goobj.FuncInfo)(nil).ReadFuncID(fi.data)
 }
 
-func (fi *FuncInfo) FuncFlag() objabi.FuncFlag {
+func (fi *FuncInfo) FuncFlag() abi.FuncFlag {
        return (*goobj.FuncInfo)(nil).ReadFuncFlag(fi.data)
 }
 
@@ -2027,7 +2027,7 @@ func (fi *FuncInfo) File(k int) goobj.CUFileIndex {
 // is an entry point, meaning that unwinders should stop when they hit
 // this function.
 func (fi *FuncInfo) TopFrame() bool {
-       return (fi.FuncFlag() & objabi.FuncFlag_TOPFRAME) != 0
+       return (fi.FuncFlag() & abi.FuncFlagTopFrame) != 0
 }
 
 type InlTreeNode struct {
index 2f8434355f4f61825a9880f55bc2c4f8dd2f4f48..c6a9689c92b3f7bc0d91ffbcdc35b9ab00c6bcda 100644 (file)
@@ -4,6 +4,31 @@
 
 package abi
 
+// A FuncFlag records bits about a function, passed to the runtime.
+type FuncFlag uint8
+
+const (
+       // FuncFlagTopFrame indicates a function that appears at the top of its stack.
+       // The traceback routine stop at such a function and consider that a
+       // successful, complete traversal of the stack.
+       // Examples of TopFrame functions include goexit, which appears
+       // at the top of a user goroutine stack, and mstart, which appears
+       // at the top of a system goroutine stack.
+       FuncFlagTopFrame FuncFlag = 1 << iota
+
+       // FuncFlagSPWrite indicates a function that writes an arbitrary value to SP
+       // (any write other than adding or subtracting a constant amount).
+       // The traceback routines cannot encode such changes into the
+       // pcsp tables, so the function traceback cannot safely unwind past
+       // SPWrite functions. Stopping at an SPWrite function is considered
+       // to be an incomplete unwinding of the stack. In certain contexts
+       // (in particular garbage collector stack scans) that is a fatal error.
+       FuncFlagSPWrite
+
+       // FuncFlagAsm indicates that a function was implemented in assembly.
+       FuncFlagAsm
+)
+
 // A FuncID identifies particular functions that need to be treated
 // specially by the runtime.
 // Note that in some situations involving plugins, there may be multiple
index a6623c0ec2d86a6a18122d0a158e1fb9d1379702..751268ee8f276ba3b1e98a18719d7686cb2cb032 100644 (file)
@@ -403,7 +403,7 @@ func isAsyncSafePoint(gp *g, pc, sp, lr uintptr) (bool, uintptr) {
                // functions (except at calls).
                return false, 0
        }
-       if fd := funcdata(f, _FUNCDATA_LocalsPointerMaps); fd == nil || f.flag&funcFlag_ASM != 0 {
+       if fd := funcdata(f, _FUNCDATA_LocalsPointerMaps); fd == nil || f.flag&abi.FuncFlagAsm != 0 {
                // This is assembly code. Don't assume it's well-formed.
                // TODO: Empirically we still need the fd == nil check. Why?
                //
index ae218da513f3168a3e81ec7e7d5eac72a8ae77d7..84a0956b5a70f3487689847562ff9a99b698afcf 100644 (file)
@@ -3573,7 +3573,7 @@ func preemptPark(gp *g) {
                if !f.valid() {
                        throw("preempt at unknown pc")
                }
-               if f.flag&funcFlag_SPWRITE != 0 {
+               if f.flag&abi.FuncFlagSPWrite != 0 {
                        println("runtime: unexpected SPWRITE function", funcname(f), "in async preempt")
                        throw("preempt SPWRITE")
                }
index 616e59c094a8638e13d697946af153c371080b16..eb9a1693baeed171f8aab03cb62aadd7af4af4fd 100644 (file)
@@ -903,7 +903,7 @@ type _func struct {
        cuOffset  uint32     // runtime.cutab offset of this function's CU
        startLine int32      // line number of start of function (func keyword/TEXT directive)
        funcID    abi.FuncID // set for certain special runtime functions
-       flag      funcFlag
+       flag      abi.FuncFlag
        _         [1]byte // pad
        nfuncdata uint8   // must be last, must end on a uint32-aligned boundary
 
index 4d3e2692e949a4f80d363a7800f007486acef4d5..82c6c9af54952e4a5b89b584af55eeb9ecb4abf4 100644 (file)
@@ -335,32 +335,6 @@ const (
        _PCDATA_RestartAtEntry = -5
 )
 
-// A FuncFlag holds bits about a function.
-// This list must match the list in cmd/internal/objabi/funcid.go.
-type funcFlag uint8
-
-const (
-       // TOPFRAME indicates a function that appears at the top of its stack.
-       // The traceback routine stop at such a function and consider that a
-       // successful, complete traversal of the stack.
-       // Examples of TOPFRAME functions include goexit, which appears
-       // at the top of a user goroutine stack, and mstart, which appears
-       // at the top of a system goroutine stack.
-       funcFlag_TOPFRAME funcFlag = 1 << iota
-
-       // SPWRITE indicates a function that writes an arbitrary value to SP
-       // (any write other than adding or subtracting a constant amount).
-       // The traceback routines cannot encode such changes into the
-       // pcsp tables, so the function traceback cannot safely unwind past
-       // SPWRITE functions. Stopping at an SPWRITE function is considered
-       // to be an incomplete unwinding of the stack. In certain contexts
-       // (in particular garbage collector stack scans) that is a fatal error.
-       funcFlag_SPWRITE
-
-       // ASM indicates that a function was implemented in assembly.
-       funcFlag_ASM
-)
-
 // pcHeader holds data used by the pclntab lookups.
 type pcHeader struct {
        magic          uint32  // 0xFFFFFFF1
index 2717b763a4d3dc5e693d9bc8a2aa754e78a8cf9c..aac19dc980ea6ca3722df2bb56ccea23ed5da742 100644 (file)
@@ -270,13 +270,13 @@ func (u *unwinder) resolveInternal(innermost, isSyscall bool) {
                // but it carefully arranges that during the transition BOTH stacks
                // have cgocallback frame valid for unwinding through.
                // So we don't need to exclude it with the other SP-writing functions.
-               flag &^= funcFlag_SPWRITE
+               flag &^= abi.FuncFlagSPWrite
        }
        if isSyscall {
                // Some Syscall functions write to SP, but they do so only after
                // saving the entry PC/SP using entersyscall.
                // Since we are using the entry PC/SP, the later SP write doesn't matter.
-               flag &^= funcFlag_SPWRITE
+               flag &^= abi.FuncFlagSPWrite
        }
 
        // Found an actual function.
@@ -315,14 +315,14 @@ func (u *unwinder) resolveInternal(innermost, isSyscall bool) {
                                        // systemstack doesn't have an SP delta (the CALL
                                        // instruction opens the frame), therefore no way
                                        // to check.
-                                       flag &^= funcFlag_SPWRITE
+                                       flag &^= abi.FuncFlagSPWrite
                                        break
                                }
                                gp = gp.m.curg
                                u.g.set(gp)
                                frame.sp = gp.sched.sp
                                u.cgoCtxt = len(gp.cgoCtxt) - 1
-                               flag &^= funcFlag_SPWRITE
+                               flag &^= abi.FuncFlagSPWrite
                        }
                }
                frame.fp = frame.sp + uintptr(funcspdelta(f, frame.pc, &u.cache))
@@ -333,10 +333,10 @@ func (u *unwinder) resolveInternal(innermost, isSyscall bool) {
        }
 
        // Derive link register.
-       if flag&funcFlag_TOPFRAME != 0 {
+       if flag&abi.FuncFlagTopFrame != 0 {
                // This function marks the top of the stack. Stop the traceback.
                frame.lr = 0
-       } else if flag&funcFlag_SPWRITE != 0 {
+       } else if flag&abi.FuncFlagSPWrite != 0 {
                // The function we are in does a write to SP that we don't know
                // how to encode in the spdelta table. Examples include context
                // switch routines like runtime.gogo but also any code that switches