Commit c996d07f authored by David Crawshaw's avatar David Crawshaw

cmd/link: use the correct module data on ppc64le

Fixes #22250

Change-Id: I0e39d10ff6f0785cd22b0105de2d839e569db4b7
Reviewed-on: https://go-review.googlesource.com/70810
Run-TryBot: David Crawshaw <crawshaw@golang.org>
Reviewed-by: 's avatarIan Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
parent e09dbaa1
......@@ -163,8 +163,10 @@ func genaddmoduledata(ctxt *ld.Link) {
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)
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment