aboutsummaryrefslogtreecommitdiff
path: root/src/runtime
diff options
context:
space:
mode:
Diffstat (limited to 'src/runtime')
-rw-r--r--src/runtime/symtab.go5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/runtime/symtab.go b/src/runtime/symtab.go
index 542c29ecd6..2f426c7bf1 100644
--- a/src/runtime/symtab.go
+++ b/src/runtime/symtab.go
@@ -375,6 +375,8 @@ type moduledata struct {
modulename string
modulehashes []modulehash
+ hasmain uint8 // 1 if module contains the main function, 0 otherwise
+
gcdatamask, gcbssmask bitvector
typemap map[typeOff]*_type // offset to *_rtype in previous module
@@ -472,9 +474,8 @@ func modulesinit() {
// contains the main function.
//
// See Issue #18729.
- mainText := funcPC(main_main)
for i, md := range *modules {
- if md.text <= mainText && mainText <= md.etext {
+ if md.hasmain != 0 {
(*modules)[0] = md
(*modules)[i] = &firstmoduledata
break