From: Than McIntosh Date: Fri, 1 Nov 2019 14:44:44 +0000 (-0400) Subject: [dev.link] all: merge branch 'master' into dev.link X-Git-Tag: go1.14beta1~292^2^2~14 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=c0555a2a7a0ca83fdbb55219299fcfe1ff33e4df;p=gostls13.git [dev.link] all: merge branch 'master' into dev.link Fixed a couple of minor conflicts in lib.go and deadcode.go relating to debug logging. Change-Id: I58335fc42ab1f1f3409fd8354da4f26419e8fb22 --- c0555a2a7a0ca83fdbb55219299fcfe1ff33e4df diff --cc src/cmd/link/internal/ld/deadcode.go index 1ff34fec5f,0bc6cc457a..e79207e2b8 --- a/src/cmd/link/internal/ld/deadcode.go +++ b/src/cmd/link/internal/ld/deadcode.go @@@ -46,15 -46,6 +46,15 @@@ import // // Any unreached text symbols are removed from ctxt.Textp. func deadcode(ctxt *Link) { + if ctxt.Debugvlog != 0 { - ctxt.Logf("%5.2f deadcode\n", Cputime()) ++ ctxt.Logf("deadcode\n") + } + + if *flagNewobj { + deadcode2(ctxt) + return + } + d := &deadcodepass{ ctxt: ctxt, ifaceMethod: make(map[methodsig]bool), diff --cc src/cmd/link/internal/ld/lib.go index 811dd0f9ef,9d99aa6f28..a0f85b85c7 --- a/src/cmd/link/internal/ld/lib.go +++ b/src/cmd/link/internal/ld/lib.go @@@ -434,16 -453,7 +434,16 @@@ func (ctxt *Link) loadlib() } } - if ctxt.LinkMode == LinkInternal { + for _, lib := range ctxt.Library { + if lib.Shlib != "" { + if ctxt.Debugvlog > 1 { - ctxt.Logf("%5.2f autolib: %s (from %s)\n", Cputime(), lib.Shlib, lib.Objref) ++ ctxt.Logf("autolib: %s (from %s)\n", lib.Shlib, lib.Objref) + } + ldshlibsyms(ctxt, lib.Shlib) + } + } + + if ctxt.LinkMode == LinkInternal && len(hostobj) != 0 { // Drop all the cgo_import_static declarations. // Turns out we won't be needing them. for _, s := range ctxt.Syms.Allsym { @@@ -2396,10 -2368,12 +2411,15 @@@ func genasmsym(ctxt *Link, put func(*Li } put(ctxt, s, s.Name, BSSSym, Symaddr(s), s.Gotype) + case sym.SUNDEFEXT: + if ctxt.HeadType == objabi.Hwindows || ctxt.HeadType == objabi.Haix || ctxt.IsELF { + put(ctxt, s, s.Name, UndefinedSym, s.Value, nil) + } + case sym.SHOSTOBJ: + if !s.Attr.Reachable() { + continue + } if ctxt.HeadType == objabi.Hwindows || ctxt.IsELF { put(ctxt, s, s.Name, UndefinedSym, s.Value, nil) }