1
0
mirror of https://github.com/golang/go synced 2024-11-26 04:58:00 -07:00

cmd/link: make npkgsyms meaningful

npkgsyms always equals 1 currently.

Change-Id: Ie88bc273beaace12ec7432054ca7c151396e8e35
GitHub-Last-Rev: c5d3b12b88
GitHub-Pull-Request: golang/go#46988
Reviewed-on: https://go-review.googlesource.com/c/go/+/331929
Reviewed-by: Cherry Mui <cherryyz@google.com>
Run-TryBot: Cherry Mui <cherryyz@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Trust: Dmitri Shuralyov <dmitshur@golang.org>
This commit is contained in:
Tao Qingyun 2021-07-01 00:22:51 +00:00 committed by Cherry Mui
parent d9244f8b64
commit 4957976b1a

View File

@ -2209,7 +2209,6 @@ func (l *Loader) LoadSyms(arch *sys.Arch) {
// Index 0 is invalid for symbols.
l.objSyms = make([]objSym, 1, symSize)
l.npkgsyms = l.NSym()
st := loadState{
l: l,
hashed64Syms: make(map[uint64]symAndSize, hashed64Size),
@ -2219,6 +2218,7 @@ func (l *Loader) LoadSyms(arch *sys.Arch) {
for _, o := range l.objs[goObjStart:] {
st.preloadSyms(o.r, pkgDef)
}
l.npkgsyms = l.NSym()
for _, o := range l.objs[goObjStart:] {
st.preloadSyms(o.r, hashed64Def)
st.preloadSyms(o.r, hashedDef)