[dev.link] cmd/compile: mark stmp and stkobj symbols as static

Mark compiler-generated ".stmp_%d" and "<fn>.stkobj" symbols as
AttrStatic, so as to tell the linker that they do not need to be
inserted into its name lookup tables.

Change-Id: I59ffd11659b2c54c2d0ad41275d05c3f919e3b88
Reviewed-on: https://go-review.googlesource.com/c/go/+/240497
Run-TryBot: Than McIntosh <thanm@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Cherry Zhang <cherryyz@google.com>
This commit is contained in:
Than McIntosh 2020-06-30 07:55:16 -04:00
parent 59a702aa6a
commit 0434d40934
4 changed files with 11 additions and 4 deletions

View file

@ -6,6 +6,7 @@ package gc
import (
"cmd/compile/internal/types"
"cmd/internal/obj"
"fmt"
)
@ -360,7 +361,7 @@ var statuniqgen int // name generator for static temps
// returned node for readonly nodes.
func staticname(t *types.Type) *Node {
// Don't use lookupN; it interns the resulting string, but these are all unique.
n := newname(lookup(fmt.Sprintf(".stmp_%d", statuniqgen)))
n := newname(lookup(fmt.Sprintf("%s%d", obj.StaticNamePref, statuniqgen)))
statuniqgen++
addvar(n, t, PEXTERN)
return n