mirror of https://github.com/golang/go.git
cmd/link: reenable internal linking PIE on linux/amd64 and linux/arm64
It was enabled in CL 207877, but then accidentally disabled in CL 207299 due to a bad rebase. Reenable. Change-Id: I147bf724a4263d4aae54576a36cc7e1cad5e8a2c Reviewed-on: https://go-review.googlesource.com/c/go/+/221098 Run-TryBot: Cherry Zhang <cherryyz@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Elias Naur <mail@eliasnaur.com> Reviewed-by: Ian Lance Taylor <iant@golang.org>
This commit is contained in:
parent
12cd55c062
commit
c70f069902
|
|
@ -247,16 +247,10 @@ func determineLinkMode(ctxt *Link) {
|
|||
ctxt.LinkMode = LinkExternal
|
||||
via = "via GO_EXTLINK_ENABLED "
|
||||
default:
|
||||
ctxt.LinkMode = LinkInternal
|
||||
switch {
|
||||
case extNeeded, iscgo && externalobj:
|
||||
if extNeeded || (iscgo && externalobj) {
|
||||
ctxt.LinkMode = LinkExternal
|
||||
case ctxt.BuildMode == BuildModePIE:
|
||||
// Android always use BuildModePIE, and needs internal linking for
|
||||
// bootstrapping.
|
||||
if objabi.GOOS != "android" || objabi.GOARCH != "arm64" {
|
||||
ctxt.LinkMode = LinkExternal
|
||||
}
|
||||
} else {
|
||||
ctxt.LinkMode = LinkInternal
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue