diff options
author | David Crawshaw <crawshaw@golang.org> | 2017-02-06 17:52:26 -0500 |
---|---|---|
committer | Russ Cox <rsc@golang.org> | 2017-02-07 01:40:49 +0000 |
commit | f0749fe163ca4917f903ed424008af37e834ace4 (patch) | |
tree | 4b3fb83796381576395b6d0375ececd67a47fd08 | |
parent | ba878ac0c8ac9701f0171a602cf344accf67c99b (diff) | |
download | go-f0749fe163ca4917f903ed424008af37e834ace4.tar.gz go-f0749fe163ca4917f903ed424008af37e834ace4.zip |
[release-branch.go1.8] cmd/link: use external linking for PIE by default
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>
Reviewed-on: https://go-review.googlesource.com/36421
Run-TryBot: Russ Cox <rsc@golang.org>
Reviewed-by: David Crawshaw <crawshaw@golang.org>
Reviewed-by: Minux Ma <minux@golang.org>
-rw-r--r-- | src/cmd/link/internal/ld/config.go | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/cmd/link/internal/ld/config.go b/src/cmd/link/internal/ld/config.go index 7d00ff1675..2656c24317 100644 --- a/src/cmd/link/internal/ld/config.go +++ b/src/cmd/link/internal/ld/config.go @@ -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 } |