]> Cypherpunks repositories - gostls13.git/commitdiff
runtime: cross-reference _func type better
authorAustin Clements <austin@google.com>
Wed, 14 Dec 2016 18:24:21 +0000 (13:24 -0500)
committerAustin Clements <austin@google.com>
Fri, 16 Dec 2016 17:03:25 +0000 (17:03 +0000)
It takes me several minutes every time I want to find where the linker
writes out the _func structures. Add some comments to make this
easier.

Change-Id: Ic75ce2786ca4b25726babe3c4fe9cd30c85c34e2
Reviewed-on: https://go-review.googlesource.com/34390
Reviewed-by: Ian Lance Taylor <iant@golang.org>
src/cmd/link/internal/ld/pcln.go
src/runtime/runtime2.go

index d317501d471af41f4e5b64d61b6ef30323532896..1ebd7de662ad4d1c2c7f5430bff15cf2fba44a9d 100644 (file)
@@ -248,6 +248,9 @@ func (ctxt *Link) pclntab() {
                setaddr(ctxt, ftab, 8+int64(SysArch.PtrSize)+int64(nfunc)*2*int64(SysArch.PtrSize), s)
                setuintxx(ctxt, ftab, 8+int64(SysArch.PtrSize)+int64(nfunc)*2*int64(SysArch.PtrSize)+int64(SysArch.PtrSize), uint64(funcstart), int64(SysArch.PtrSize))
 
+               // Write runtime._func. Keep in sync with ../../../../runtime/runtime2.go:/_func
+               // and package debug/gosym.
+
                // fixed size of struct, checked below
                off := funcstart
 
index 696ea81e00f1556383852a2d2d71eaadbe16a604..72524f53af28fbc6280637cb283326cbc90372a8 100644 (file)
@@ -615,7 +615,7 @@ const (
 
 // Layout of in-memory per-function information prepared by linker
 // See https://golang.org/s/go12symtab.
-// Keep in sync with linker
+// Keep in sync with linker (../cmd/link/internal/ld/pcln.go:/pclntab)
 // and with package debug/gosym and with symtab.go in package runtime.
 type _func struct {
        entry   uintptr // start pc