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 <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>
This commit is contained in:
Josh Bleecher Snyder 2021-09-21 09:45:34 -07:00
parent f0c79caa13
commit 8e34d77957
2 changed files with 8 additions and 8 deletions

View 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

View 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