Skip to content

Commit

Permalink
cmd/link: Revert -buildmode=pie to internal linking
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
CornePlas authored and cherrymui committed Feb 25, 2020
1 parent 1858980 commit b2696fd
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/cmd/link/internal/ld/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit b2696fd

Please sign in to comment.