cmd/link: enable -buildmode=plugin for ppc64le

This enables support for the buildmode plugin on
ppc64le.

Fixes #20756

Change-Id: I83241ff63f9b5c366fe0496cf46a3f67d75d08ac
Reviewed-on: https://go-review.googlesource.com/55850
Run-TryBot: Lynn Boger <laboger@linux.vnet.ibm.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: David Crawshaw <crawshaw@golang.org>
This commit is contained in:
Lynn Boger 2017-08-15 14:34:53 -04:00
parent dc3b8a193c
commit e9cbabb334
5 changed files with 21 additions and 7 deletions

View file

@ -168,8 +168,12 @@ func (ctxt *Link) DynlinkingGo() bool {
if !ctxt.Loaded {
panic("DynlinkingGo called before all symbols loaded")
}
canUsePlugins := ctxt.Syms.ROLookup("plugin.Open", 0) != nil
return Buildmode == BuildmodeShared || *FlagLinkshared || Buildmode == BuildmodePlugin || canUsePlugins
return Buildmode == BuildmodeShared || *FlagLinkshared || Buildmode == BuildmodePlugin || ctxt.CanUsePlugins()
}
// CanUsePlugins returns whether a plugins can be used
func (ctxt *Link) CanUsePlugins() bool {
return ctxt.Syms.ROLookup("plugin.Open", 0) != nil
}
// UseRelro returns whether to make use of "read only relocations" aka