1
0
mirror of https://github.com/golang/go synced 2024-09-29 19:24:33 -06:00

cmd/link: Revert -buildmode=pie to internal linking

When internal linking was broken buildmode PIE is set to external
linking. Now internal linking is fixed, -buildmode=pie can default to
internal linking again.

Fixes #35545

Change-Id: Iaf86b3047eb76babebc1545a79125586a7a3980e
Reviewed-on: https://go-review.googlesource.com/c/go/+/207877
Run-TryBot: Cherry Zhang <cherryyz@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Cherry Zhang <cherryyz@google.com>
This commit is contained in:
Corne van der Plas 2019-11-19 13:22:55 +01:00 committed by Cherry Zhang
parent 1858980645
commit b2696fde40

View File

@ -244,7 +244,7 @@ func determineLinkMode(ctxt *Link) {
ctxt.LinkMode = LinkExternal
via = "via GO_EXTLINK_ENABLED "
default:
if extNeeded || (iscgo && externalobj) || ctxt.BuildMode == BuildModePIE {
if extNeeded || (iscgo && externalobj) {
ctxt.LinkMode = LinkExternal
} else {
ctxt.LinkMode = LinkInternal