]> Cypherpunks repositories - gostls13.git/commitdiff
runtime: avoid dependence on main symbol
authorDavid Crawshaw <crawshaw@golang.org>
Fri, 26 Aug 2016 02:04:04 +0000 (22:04 -0400)
committerDavid Crawshaw <crawshaw@golang.org>
Fri, 16 Sep 2016 14:49:27 +0000 (14:49 +0000)
For -buildmode=plugin, this lets the linker drop the main.main symbol
out of the binary while including most of the runtime.

(In the future it should be possible to drop the entire runtime
package from plugins.)

Change-Id: I3e7a024ddf5cc945e3d8b84bf37a0b7cb2a00eb6
Reviewed-on: https://go-review.googlesource.com/27821
Run-TryBot: David Crawshaw <crawshaw@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
src/runtime/proc.go

index 67e8447d46adf5555512744800eb7af51a7f4a91..4dd2bd200541cdb64d9a7e4c9e03b1211681683b 100644 (file)
@@ -2806,7 +2806,7 @@ func newproc1(fn *funcval, argp *uint8, narg int32, nret int32, callerpc uintptr
        }
        runqput(_p_, newg, true)
 
-       if atomic.Load(&sched.npidle) != 0 && atomic.Load(&sched.nmspinning) == 0 && unsafe.Pointer(fn.fn) != unsafe.Pointer(funcPC(main)) {
+       if atomic.Load(&sched.npidle) != 0 && atomic.Load(&sched.nmspinning) == 0 && runtimeInitTime != 0 {
                wakep()
        }
        _g_.m.locks--