Fixes #22250
Change-Id: I0e39d10ff6f0785cd22b0105de2d839e569db4b7
Reviewed-on: https://go-review.googlesource.com/70810
Run-TryBot: David Crawshaw <crawshaw@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
rel = initfunc.AddRel()
rel.Off = int32(initfunc.Size)
rel.Siz = 8
- if !ctxt.CanUsePlugins() {
- rel.Sym = ctxt.Syms.Lookup("local.moduledata", 0)
+ if s := ctxt.Syms.ROLookup("local.moduledata", 0); s != nil {
+ rel.Sym = s
+ } else if s := ctxt.Syms.ROLookup("local.pluginmoduledata", 0); s != nil {
+ rel.Sym = s
} else {
rel.Sym = ctxt.Syms.Lookup("runtime.firstmoduledata", 0)
}