1
0
mirror of https://github.com/golang/go synced 2024-11-07 23:06:14 -07:00
go/misc/cgo/testplugin
David Crawshaw c58b98b2d6 cmd/link, runtime: put hasmain bit in moduledata
Currently we look to see if the main.main symbol address is in the
module data text range. This requires access to the main.main
symbol, which usually the runtime has, but does not when building
a plugin.

To avoid a dynamic relocation to main.main (which I haven't worked
out how to have the linker generate on darwin), stop using the
symbol. Instead record a boolean in the moduledata if the module
has the main function.

Fixes #22175

Change-Id: If313a118f17ab499d0a760bbc2519771ed654530
Reviewed-on: https://go-review.googlesource.com/69370
Run-TryBot: David Crawshaw <crawshaw@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2017-10-13 01:13:33 +00:00
..
altpath/src
src cmd/link, runtime: put hasmain bit in moduledata 2017-10-13 01:13:33 +00:00
unnamed1 cmd/go: add source file contents to plugin hash 2017-09-09 15:58:20 +00:00
unnamed2 cmd/go: add source file contents to plugin hash 2017-09-09 15:58:20 +00:00
test.bash cmd/link, runtime: put hasmain bit in moduledata 2017-10-13 01:13:33 +00:00