]> Cypherpunks repositories - gostls13.git/commitdiff
runtime, cmd/link: minor cleanup
authorJosh Bleecher Snyder <josharian@gmail.com>
Tue, 21 Sep 2021 16:45:34 +0000 (09:45 -0700)
committerJosh Bleecher Snyder <josharian@gmail.com>
Mon, 27 Sep 2021 20:59:14 +0000 (20:59 +0000)
Fix some comments.
Adjust capitalization for initialisms.
Use a println directly instead of emulating it.

Change-Id: I0d8fa0eb39547e2db8113fd0358136285b86f16a
Reviewed-on: https://go-review.googlesource.com/c/go/+/351462
Trust: Josh Bleecher Snyder <josharian@gmail.com>
Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Cherry Mui <cherryyz@google.com>
Reviewed-by: Than McIntosh <thanm@google.com>
src/cmd/link/internal/ld/pcln.go
src/runtime/symtab.go

index 56c4fe0b460b88864ef9c11611a407e88d3b908c..fede00586be6c87083da1d15c76ff2dcc62c88c0 100644 (file)
@@ -551,7 +551,7 @@ type pclnSetUint func(*loader.SymbolBuilder, *sys.Arch, int64, uint64) int64
 //   1) the PC->func table.
 //   2) The entry points in the func objects.
 //   3) The funcdata.
-// (1) and (2) are handled in walkPCToFunc. (3) is handled in walkFuncdata.
+// (1) and (2) are handled in writePCToFunc. (3) is handled in writeFuncdata.
 //
 // After relocations, once we know where to write things in the output buffer,
 // we execute the second pass, which is actually writing the data.
@@ -586,7 +586,7 @@ func (state *pclntab) generateFunctab(ctxt *Link, funcs []loader.Sym, inlSyms ma
                }
 
                // Write the data.
-               writePcToFunc(ctxt, sb, funcs, startLocations, setAddr, (*loader.SymbolBuilder).SetUint)
+               writePCToFunc(ctxt, sb, funcs, startLocations, setAddr, (*loader.SymbolBuilder).SetUint)
                writeFuncs(ctxt, sb, funcs, inlSyms, startLocations, cuOffsets, nameOffsets)
                state.writeFuncData(ctxt, sb, funcs, inlSyms, startLocations, setAddr, (*loader.SymbolBuilder).SetUint)
        }
@@ -611,7 +611,7 @@ func (state *pclntab) generateFunctab(ctxt *Link, funcs []loader.Sym, inlSyms ma
                setAddr = (*loader.SymbolBuilder).SetAddrPlus
        }
        setUintNOP := func(*loader.SymbolBuilder, *sys.Arch, int64, uint64) int64 { return 0 }
-       writePcToFunc(ctxt, sb, funcs, startLocations, setAddr, setUintNOP)
+       writePCToFunc(ctxt, sb, funcs, startLocations, setAddr, setUintNOP)
        if !useSymValue {
                // Generate relocations for funcdata when externally linking.
                state.writeFuncData(ctxt, sb, funcs, inlSyms, startLocations, setAddr, setUintNOP)
@@ -687,10 +687,10 @@ func (state pclntab) calculateFunctabSize(ctxt *Link, funcs []loader.Sym) (int64
        return size, startLocations
 }
 
-// writePcToFunc writes the PC->func lookup table.
+// writePCToFunc writes the PC->func lookup table.
 // This function walks the pc->func lookup table, executing callbacks
 // to generate relocations and writing the values for the table.
-func writePcToFunc(ctxt *Link, sb *loader.SymbolBuilder, funcs []loader.Sym, startLocations []uint32, setAddr pclnSetAddr, setUint pclnSetUint) {
+func writePCToFunc(ctxt *Link, sb *loader.SymbolBuilder, funcs []loader.Sym, startLocations []uint32, setAddr pclnSetAddr, setUint pclnSetUint) {
        ldr := ctxt.loader
        var prevFunc loader.Sym
        prevSect := ldr.SymSect(funcs[0])
@@ -775,8 +775,8 @@ func writeFuncs(ctxt *Link, sb *loader.SymbolBuilder, funcs []loader.Sym, inlSym
                        fi.Preload()
                }
 
-               // Note we skip the space for the entry value -- that's handled inn
-               // walkPCToFunc. We don't write it here, because it might require a
+               // Note we skip the space for the entry value -- that's handled in
+               // writePCToFunc. We don't write it here, because it might require a
                // relocation.
                off := startLocations[i] + uint32(ctxt.Arch.PtrSize) // entry
 
index 7a9bb3e06b31965a7425a47b9341c65517cde970..792513f79679d0ecd8e1a5b9142ad8c96f5402b5 100644 (file)
@@ -846,7 +846,7 @@ func pcvalue(f funcInfo, off uint32, targetpc uintptr, cache *pcvalueCache, stri
 
        if !f.valid() {
                if strict && panicking == 0 {
-                       print("runtime: no module data for ", hex(f.entry()), "\n")
+                       println("runtime: no module data for", hex(f.entry()))
                        throw("no module data")
                }
                return -1, 0