]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/link/internal/ld: update _func names to match runtime
authorMichael Pratt <mpratt@google.com>
Tue, 6 Sep 2022 22:00:35 +0000 (18:00 -0400)
committerGopher Robot <gobot@golang.org>
Wed, 7 Sep 2022 16:37:07 +0000 (16:37 +0000)
Change-Id: I4a47f676c0e533f7612fc3eb1b5dd8039f72782f
Reviewed-on: https://go-review.googlesource.com/c/go/+/428659
Reviewed-by: Cherry Mui <cherryyz@google.com>
Auto-Submit: Michael Pratt <mpratt@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Run-TryBot: Michael Pratt <mpratt@google.com>

src/cmd/link/internal/ld/pcln.go

index 9b743a853050c453c31138f77be5123fc1eedabb..2a1e15cddb9d1ce0783123f9d607bed59cb062a6 100644 (file)
@@ -162,7 +162,7 @@ func genInlTreeSym(ctxt *Link, cu *sym.CompilationUnit, fi loader.FuncInfo, arch
        ninl := fi.NumInlTree()
        for i := 0; i < int(ninl); i++ {
                call := fi.InlTree(i)
-               nameoff, ok := nameOffsets[call.Func]
+               nameOff, ok := nameOffsets[call.Func]
                if !ok {
                        panic("couldn't find function name offset")
                }
@@ -176,7 +176,7 @@ func genInlTreeSym(ctxt *Link, cu *sym.CompilationUnit, fi loader.FuncInfo, arch
                const size = 12
                inlTreeSym.SetUint8(arch, int64(i*size+0), uint8(funcID))
                // Bytes 1-3 are unused.
-               inlTreeSym.SetUint32(arch, int64(i*size+4), uint32(nameoff))
+               inlTreeSym.SetUint32(arch, int64(i*size+4), uint32(nameOff))
                inlTreeSym.SetUint32(arch, int64(i*size+8), uint32(call.ParentPC))
        }
        return its
@@ -639,19 +639,19 @@ func writeFuncs(ctxt *Link, sb *loader.SymbolBuilder, funcs []loader.Sym, inlSym
                }
 
                off := int64(startLocations[i])
-               // entry uintptr (offset of func entry PC from textStart)
+               // entryOff uint32 (offset of func entry PC from textStart)
                entryOff := ldr.SymValue(s) - textStart
                if entryOff < 0 {
                        panic(fmt.Sprintf("expected func %s(%x) to be placed before or at textStart (%x)", ldr.SymName(s), ldr.SymValue(s), textStart))
                }
                off = sb.SetUint32(ctxt.Arch, off, uint32(entryOff))
 
-               // name int32
-               nameoff, ok := nameOffsets[s]
+               // nameOff int32
+               nameOff, ok := nameOffsets[s]
                if !ok {
                        panic("couldn't find function name offset")
                }
-               off = sb.SetUint32(ctxt.Arch, off, uint32(nameoff))
+               off = sb.SetUint32(ctxt.Arch, off, uint32(nameOff))
 
                // args int32
                // TODO: Move into funcinfo.