1
0
mirror of https://github.com/golang/go synced 2024-11-24 06:40:17 -07:00
go/misc/cgo
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
..
errors misc/cgo/errors: don't pass -C to compiler 2017-09-14 04:02:01 +00:00
fortran *.bash: always use the same string equality operator 2017-03-14 21:46:31 +00:00
gmp
life
nocgo
stdio
test go/printer: fix formatting of three-index slice expression 2017-10-03 16:16:30 +00:00
testasan
testcarchive misc/cgo/testcarchive: use -no-pie where needed 2017-10-11 21:01:45 +00:00
testcshared misc/cgo/testcshared: don't overwrite cc in parallel runs 2017-10-09 05:31:01 +00:00
testgodefs
testplugin cmd/link, runtime: put hasmain bit in moduledata 2017-10-13 01:13:33 +00:00
testsanitizers misc/cgo/testsanitizers: convert test.bash to Go 2017-08-17 15:05:08 +00:00
testshared cmd/go: clean up compile vs link vs shared library actions 2017-10-11 17:47:09 +00:00
testsigfwd
testso
testsovar
testtls