From: Josh Bleecher Snyder Date: Tue, 21 Sep 2021 16:45:34 +0000 (-0700) Subject: runtime, cmd/link: minor cleanup X-Git-Tag: go1.18beta1~1163 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=8e34d779578736942c78f9857f5bb9b9025815c6;p=gostls13.git runtime, cmd/link: minor cleanup 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 Run-TryBot: Josh Bleecher Snyder TryBot-Result: Go Bot Reviewed-by: Cherry Mui Reviewed-by: Than McIntosh --- diff --git a/src/cmd/link/internal/ld/pcln.go b/src/cmd/link/internal/ld/pcln.go index 56c4fe0b46..fede00586b 100644 --- a/src/cmd/link/internal/ld/pcln.go +++ b/src/cmd/link/internal/ld/pcln.go @@ -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 diff --git a/src/runtime/symtab.go b/src/runtime/symtab.go index 7a9bb3e06b..792513f796 100644 --- a/src/runtime/symtab.go +++ b/src/runtime/symtab.go @@ -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