Skip to content

Commit f0749fe

Browse files
crawshawrsc
authored andcommitted
[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 <[email protected]> Run-TryBot: Ian Lance Taylor <[email protected]> TryBot-Result: Gobot Gobot <[email protected]> Reviewed-on: https://go-review.googlesource.com/36421 Run-TryBot: Russ Cox <[email protected]> Reviewed-by: David Crawshaw <[email protected]> Reviewed-by: Minux Ma <[email protected]>
1 parent ba878ac commit f0749fe

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

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

+2
Original file line numberDiff line numberDiff line change
@@ -238,6 +238,8 @@ func determineLinkMode(ctxt *Link) {
238238
Linkmode = LinkExternal
239239
} else if iscgo && externalobj {
240240
Linkmode = LinkExternal
241+
} else if Buildmode == BuildmodePIE {
242+
Linkmode = LinkExternal // https://golang.org/issue/18968
241243
} else {
242244
Linkmode = LinkInternal
243245
}

0 commit comments

Comments
 (0)