]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/link: Revert -buildmode=pie to internal linking
authorCorne van der Plas <vdplas@gmail.com>
Tue, 19 Nov 2019 12:22:55 +0000 (13:22 +0100)
committerCherry Zhang <cherryyz@google.com>
Tue, 25 Feb 2020 15:13:24 +0000 (15:13 +0000)
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>
src/cmd/link/internal/ld/config.go

index dcbe1368321d5fd27b9f3f502e442bf8dae73200..86d8779512bd07b6c5a94e638aff5d48f564f610 100644 (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