Commit 8bb39131 authored by isharipo's avatar isharipo Committed by Brad Fitzpatrick

cmd/link/internal/ld: don't call fieldtrack if it's not enabled

If go toolchain is not built with GOEXPERIMENT=fieldtrack,
skip fieldtrack pass in the linker as it does full symtab traversal.

For linking "hello world" example from net/http:

	name      old time/op  new time/op  delta
	Linker-4   530ms ± 2%   525ms ± 2%  -1.03%  (p=0.028 n=17+19)

Fixes #20318
Updates #14624

Change-Id: I99336513db77d13f95f47d27339d76f01c42a5da
Reviewed-on: https://go-review.googlesource.com/113635
Run-TryBot: Iskander Sharipov <iskander.sharipov@intel.com>
Reviewed-by: default avatarBrad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
parent d2c68bb6
......@@ -202,7 +202,9 @@ func Main(arch *sys.Arch, theArch Arch) {
ctxt.dostrdata()
deadcode(ctxt)
if objabi.Fieldtrack_enabled != 0 {
fieldtrack(ctxt)
}
ctxt.callgraph()
ctxt.doelf()
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment