]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/link: use the correct module data on ppc64le
authorDavid Crawshaw <crawshaw@golang.org>
Fri, 13 Oct 2017 20:50:45 +0000 (16:50 -0400)
committerDavid Crawshaw <crawshaw@golang.org>
Fri, 13 Oct 2017 22:46:25 +0000 (22:46 +0000)
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>

src/cmd/link/internal/ppc64/asm.go

index 6dcf04ec075c5995802637ee1a6b9fa8fc751ff7..41f0c31cd0dcec10f0cc06d45c56820db5590216 100644 (file)
@@ -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)
        }