cmd/link/internal: eliminate all ld.Cputime() usages

Also a similar 'elapsed' function and its usages were deleted.

Fixes #19865.

Change-Id: Ib125365e69cf2eda60de64fa74290c8c7d1fd65a
Reviewed-on: https://go-review.googlesource.com/c/go/+/171730
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Cherry Zhang <cherryyz@google.com>
Reviewed-by: Than McIntosh <thanm@google.com>
This commit is contained in:
nikita-vanyasin 2019-04-13 16:42:48 +03:00 committed by Josh Bleecher Snyder
parent 65a1e24209
commit c3e8a20a65
17 changed files with 12 additions and 259 deletions

View file

@ -163,10 +163,6 @@ func archrelocvariant(ctxt *ld.Link, r *sym.Reloc, s *sym.Symbol, t int64) int64
}
func asmb(ctxt *ld.Link) {
if ctxt.Debugvlog != 0 {
ctxt.Logf("%5.2f asmb\n", ld.Cputime())
}
if ctxt.IsELF {
ld.Asmbelfsetup()
}
@ -180,18 +176,10 @@ func asmb(ctxt *ld.Link) {
}
if ld.Segrodata.Filelen > 0 {
if ctxt.Debugvlog != 0 {
ctxt.Logf("%5.2f rodatblk\n", ld.Cputime())
}
ctxt.Out.SeekSet(int64(ld.Segrodata.Fileoff))
ld.Datblk(ctxt, int64(ld.Segrodata.Vaddr), int64(ld.Segrodata.Filelen))
}
if ctxt.Debugvlog != 0 {
ctxt.Logf("%5.2f datblk\n", ld.Cputime())
}
ctxt.Out.SeekSet(int64(ld.Segdata.Fileoff))
ld.Datblk(ctxt, int64(ld.Segdata.Vaddr), int64(ld.Segdata.Filelen))
@ -209,33 +197,19 @@ func asmb2(ctxt *ld.Link) {
if !ctxt.IsELF {
ld.Errorf(nil, "unsupported executable format")
}
if ctxt.Debugvlog != 0 {
ctxt.Logf("%5.2f sym\n", ld.Cputime())
}
symo = uint32(ld.Segdwarf.Fileoff + ld.Segdwarf.Filelen)
symo = uint32(ld.Rnd(int64(symo), int64(*ld.FlagRound)))
ctxt.Out.SeekSet(int64(symo))
if ctxt.Debugvlog != 0 {
ctxt.Logf("%5.2f elfsym\n", ld.Cputime())
}
ld.Asmelfsym(ctxt)
ctxt.Out.Flush()
ctxt.Out.Write(ld.Elfstrdat)
if ctxt.Debugvlog != 0 {
ctxt.Logf("%5.2f dwarf\n", ld.Cputime())
}
if ctxt.LinkMode == ld.LinkExternal {
ld.Elfemitreloc(ctxt)
}
}
if ctxt.Debugvlog != 0 {
ctxt.Logf("%5.2f header\n", ld.Cputime())
}
ctxt.Out.SeekSet(0)
switch ctxt.HeadType {
default: