diff options
Diffstat (limited to 'src/cmd/nm')
| -rw-r--r-- | src/cmd/nm/nm_test.go | 15 |
1 files changed, 3 insertions, 12 deletions
diff --git a/src/cmd/nm/nm_test.go b/src/cmd/nm/nm_test.go index 014a5d2bd7..8c23d73d6d 100644 --- a/src/cmd/nm/nm_test.go +++ b/src/cmd/nm/nm_test.go @@ -6,6 +6,7 @@ package main import ( "internal/obscuretestdata" + "internal/platform" "internal/testenv" "os" "path/filepath" @@ -165,20 +166,10 @@ func testGoExec(t *testing.T, iscgo, isexternallinker bool) { return true } } - // Code is always relocated if the default buildmode is PIE. - // - // TODO(#58807): factor this condition out into a function in - // internal/platform so that it won't get out of sync with cmd/go and - // cmd/link. - if runtime.GOOS == "android" { + if platform.DefaultPIE(runtime.GOOS, runtime.GOARCH) { + // Code is always relocated if the default buildmode is PIE. return true } - if runtime.GOOS == "windows" { - return true - } - if runtime.GOOS == "darwin" && runtime.GOARCH == "arm64" { - return true // On darwin/arm64 everything is PIE - } return false } |
