aboutsummaryrefslogtreecommitdiff
path: root/src/internal/testenv
diff options
context:
space:
mode:
authorThan McIntosh <thanm@google.com>2024-03-13 17:49:32 +0000
committerThan McIntosh <thanm@google.com>2024-03-15 16:11:52 +0000
commit88480fadcc5874f880623ca50713d0c62cc5259b (patch)
tree13850dc7f3cfa5c7229c46e109695b8aadc6c734 /src/internal/testenv
parentd838e4dcdf89124ed051e1c53e8472e900664a6b (diff)
downloadgo-88480fadcc5874f880623ca50713d0c62cc5259b.tar.xz
cmd/link: support -bindnow option and permit use of "-Wl,-z,now"
This is a partial roll-forward of CL 473495, which was subsequently reverted. The second half of CL 473495 will appear in a future CL. In this patch we introduce a new Go linker "-bindnow" command line flag, and update the Go command to permit the use of the -Wl,-z,now option, to allow users to produce binaries that have immediate binding. Updates #45681. Change-Id: Idd61b0d6597bcd37b16c343714c55a4ef6dfb534 Reviewed-on: https://go-review.googlesource.com/c/go/+/571416 Reviewed-by: Cherry Mui <cherryyz@google.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Diffstat (limited to 'src/internal/testenv')
-rw-r--r--src/internal/testenv/testenv.go9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/internal/testenv/testenv.go b/src/internal/testenv/testenv.go
index f767ac590c..3b9d2fd1e9 100644
--- a/src/internal/testenv/testenv.go
+++ b/src/internal/testenv/testenv.go
@@ -369,6 +369,15 @@ func MustInternalLink(t testing.TB, withCgo bool) {
}
}
+// MustInternalLinkPIE checks whether the current system can link PIE binary using
+// internal linking.
+// If not, MustInternalLinkPIE calls t.Skip with an explanation.
+func MustInternalLinkPIE(t testing.TB) {
+ if !platform.InternalLinkPIESupported(runtime.GOOS, runtime.GOARCH) {
+ t.Skipf("skipping test: internal linking for buildmode=pie on %s/%s is not supported", runtime.GOOS, runtime.GOARCH)
+ }
+}
+
// MustHaveBuildMode reports whether the current system can build programs in
// the given build mode.
// If not, MustHaveBuildMode calls t.Skip with an explanation.