From: David Crawshaw Date: Fri, 13 Oct 2017 20:50:45 +0000 (-0400) Subject: cmd/link: use the correct module data on ppc64le X-Git-Tag: go1.10beta1~717 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=c996d07feed18fdebaadf2c61e62cd8b14fe1aa7;p=gostls13.git 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 Reviewed-by: Ian Lance Taylor TryBot-Result: Gobot Gobot --- diff --git a/src/cmd/link/internal/ppc64/asm.go b/src/cmd/link/internal/ppc64/asm.go index 6dcf04ec07..41f0c31cd0 100644 --- a/src/cmd/link/internal/ppc64/asm.go +++ b/src/cmd/link/internal/ppc64/asm.go @@ -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) }