aboutsummaryrefslogtreecommitdiff
path: root/src/cmd
diff options
context:
space:
mode:
authorCherry Zhang <cherryyz@google.com>2020-05-12 18:53:55 -0400
committerCherry Zhang <cherryyz@google.com>2020-05-13 15:44:56 +0000
commit1024cabc4833fb654f3e2661a416367342277f95 (patch)
tree9e492511132d221400c66e0357e09394fe1ae451 /src/cmd
parent9c3c8c1b12747dc84ac2c0efdf265f8a49ae9d88 (diff)
downloadgo-1024cabc4833fb654f3e2661a416367342277f95.tar.xz
[dev.link] cmd/link: remove extSymPayload.gotype field
We have the information from auxs. Remove the field, slightly reduce memory usage. Change-Id: I3881777cfb40b03d0e2b0e7a326b0738080548b0 Reviewed-on: https://go-review.googlesource.com/c/go/+/233778 Run-TryBot: Cherry Zhang <cherryyz@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Than McIntosh <thanm@google.com>
Diffstat (limited to 'src/cmd')
-rw-r--r--src/cmd/link/internal/loader/loader.go23
1 files changed, 8 insertions, 15 deletions
diff --git a/src/cmd/link/internal/loader/loader.go b/src/cmd/link/internal/loader/loader.go
index 7ee5bacb5a..60f24a3b41 100644
--- a/src/cmd/link/internal/loader/loader.go
+++ b/src/cmd/link/internal/loader/loader.go
@@ -322,7 +322,6 @@ type extSymPayload struct {
ver int
kind sym.SymKind
objidx uint32 // index of original object if sym made by cloneToExternal
- gotype Sym // Gotype (0 if not present)
relocs []goobj2.Reloc
reltypes []objabi.RelocType // relocation types
data []byte
@@ -1411,12 +1410,17 @@ func (l *Loader) DynidSyms() []Sym {
// results in to a map (might want to try this at some point and see
// if it helps speed things up).
func (l *Loader) SymGoType(i Sym) Sym {
+ var r *oReader
+ var auxs []goobj2.Aux
if l.IsExternal(i) {
pp := l.getPayload(i)
- return pp.gotype
+ r = l.objs[pp.objidx].r
+ auxs = pp.auxs
+ } else {
+ var li int
+ r, li = l.toLocal(i)
+ auxs = r.Auxs(li)
}
- r, li := l.toLocal(i)
- auxs := r.Auxs(li)
for j := range auxs {
a := &auxs[j]
switch a.Type() {
@@ -2580,17 +2584,6 @@ func (l *Loader) cloneToExternal(symIdx Sym) {
// Gotype, so as to propagate it to the new symbol.
auxs := r.Auxs(li)
pp.auxs = auxs
-loop:
- for j := range auxs {
- a := &auxs[j]
- switch a.Type() {
- case goobj2.AuxGotype:
- pp.gotype = l.resolve(r, a.Sym())
- break loop
- default:
- // nothing to do
- }
- }
// Install new payload to global index space.
// (This needs to happen at the end, as the accessors above