diff options
| author | Cherry Zhang <cherryyz@google.com> | 2020-03-06 01:15:07 -0500 |
|---|---|---|
| committer | Cherry Zhang <cherryyz@google.com> | 2020-03-16 17:33:43 +0000 |
| commit | 8a074fa275261a3dd1690f81e4fa6c45bdbb0471 (patch) | |
| tree | d97d31b8473df5b991ba28450e8885e098c0a598 /src/cmd/link/internal/ld/deadcode2.go | |
| parent | 8e100a05a5d72c2f2b079d8791edf700c612e45e (diff) | |
| download | go-8a074fa275261a3dd1690f81e4fa6c45bdbb0471.tar.xz | |
[dev.link] cmd/internal/goobj2, cmd/link: experiment new aux symbol accessors
Following the previous CLs, do the same for aux symbols. This has
some small speedup:
(linking cmd/compile)
Dostkcheck 41.0ms ± 1% 38.6ms ± 1% -6.00% (p=0.008 n=5+5)
Change-Id: Id62b2fc9e4ef1be92e60e4c03faec0a953eee94e
Reviewed-on: https://go-review.googlesource.com/c/go/+/222303
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/link/internal/ld/deadcode2.go')
| -rw-r--r-- | src/cmd/link/internal/ld/deadcode2.go | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/src/cmd/link/internal/ld/deadcode2.go b/src/cmd/link/internal/ld/deadcode2.go index cbf7e22dbd..5088a6e1be 100644 --- a/src/cmd/link/internal/ld/deadcode2.go +++ b/src/cmd/link/internal/ld/deadcode2.go @@ -118,7 +118,6 @@ func (d *deadcodePass2) init() { } func (d *deadcodePass2) flood() { - auxSyms := []loader.Sym{} for !d.wq.empty() { symIdx := d.wq.pop() @@ -162,9 +161,9 @@ func (d *deadcodePass2) flood() { } d.mark(r.Sym(), symIdx) } - auxSyms = d.ldr.ReadAuxSyms(symIdx, auxSyms) - for i := 0; i < len(auxSyms); i++ { - d.mark(auxSyms[i], symIdx) + naux := d.ldr.NAux(symIdx) + for i := 0; i < naux; i++ { + d.mark(d.ldr.Aux2(symIdx, i).Sym(), symIdx) } // Some host object symbols have an outer object, which acts like a // "carrier" symbol, or it holds all the symbols for a particular |
