From 3bf141955be1d1f791f643700fbde60c258546d3 Mon Sep 17 00:00:00 2001 From: David Crawshaw Date: Tue, 6 Sep 2016 09:16:48 -0400 Subject: [PATCH] cmd/dist: test PIE internal linking on linux/amd64 Change-Id: I88dd0811db3a9864106def47b89848f5c8de94d4 Reviewed-on: https://go-review.googlesource.com/28545 Run-TryBot: David Crawshaw TryBot-Result: Gobot Gobot Reviewed-by: Brad Fitzpatrick --- src/cmd/dist/test.go | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/cmd/dist/test.go b/src/cmd/dist/test.go index 7073992e6e..a3c565967f 100644 --- a/src/cmd/dist/test.go +++ b/src/cmd/dist/test.go @@ -422,6 +422,18 @@ func (t *tester) registerTests() { }) } + // Test internal linking of PIE binaries where it is supported. + if t.goos == "linux" && t.goarch == "amd64" { + t.tests = append(t.tests, distTest{ + name: "pie_internal", + heading: "internal linking of -buildmode=pie", + fn: func(dt *distTest) error { + t.addCmd(dt, "src", "go", "test", "reflect", "-short", "-buildmode=pie", "-ldflags=-linkmode=internal", t.timeout(60), t.tags(), t.runFlag("")) + return nil + }, + }) + } + // sync tests t.tests = append(t.tests, distTest{ name: "sync_cpu", -- 2.48.1