]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/link: use external linking for PIE by default
authorDavid Crawshaw <crawshaw@golang.org>
Mon, 6 Feb 2017 22:52:26 +0000 (17:52 -0500)
committerDavid Crawshaw <crawshaw@golang.org>
Mon, 6 Feb 2017 23:04:46 +0000 (23:04 +0000)
Now `go test -buildmode=pie std -short` passes on linux/amd64.

Updates #18968

Change-Id: Ide21877713e00edc64c1700c950016d6bff8de0e
Reviewed-on: https://go-review.googlesource.com/36417
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>

src/cmd/link/internal/ld/config.go

index 7d00ff167553d860096bc65a54617c7948d55195..2656c243174384876c921757a36471b7fb2b29f2 100644 (file)
@@ -238,6 +238,8 @@ func determineLinkMode(ctxt *Link) {
                                Linkmode = LinkExternal
                        } else if iscgo && externalobj {
                                Linkmode = LinkExternal
+                       } else if Buildmode == BuildmodePIE {
+                               Linkmode = LinkExternal // https://golang.org/issue/18968
                        } else {
                                Linkmode = LinkInternal
                        }