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: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
diff --git a/src/cmd/link/internal/ppc64/asm.go b/src/cmd/link/internal/ppc64/asm.go
index 6dcf04e..41f0c31 100644
--- a/src/cmd/link/internal/ppc64/asm.go
+++ b/src/cmd/link/internal/ppc64/asm.go
@@ -163,8 +163,10 @@
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)
}