From fb45b084c82d7d863edff5e3ccf2f302056cd8e6 Mon Sep 17 00:00:00 2001 From: Ian Lance Taylor Date: Fri, 30 Jan 2026 19:18:14 -0800 Subject: [PATCH] cmd/link: only run ELF tests on ELF systems Running these tests on other systems is a pointless waste of time. This runs cmd/link/internal/ld/elf_test.go in the same cases that we run cmd/link/elf_test.go. Change-Id: I318fb5c2de9e4cfdb976bc2389c72cede6661b47 Reviewed-on: https://go-review.googlesource.com/c/go/+/740782 Reviewed-by: Cherry Mui Reviewed-by: Michael Knyszek Auto-Submit: Ian Lance Taylor LUCI-TryBot-Result: Go LUCI --- src/cmd/link/internal/ld/elf_test.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/cmd/link/internal/ld/elf_test.go b/src/cmd/link/internal/ld/elf_test.go index 0b3229e29c..a80ff4a7b3 100644 --- a/src/cmd/link/internal/ld/elf_test.go +++ b/src/cmd/link/internal/ld/elf_test.go @@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -//go:build cgo +//go:build cgo && (dragonfly || freebsd || linux || netbsd || openbsd || solaris) package ld @@ -52,7 +52,7 @@ func main() { elfFile, err := elf.NewFile(fi) if err != nil { - t.Skip("The system may not support ELF, skipped.") + t.Fatal(err) } section := elfFile.Section(".dynsym") @@ -153,7 +153,7 @@ func main() { elfFile, err := elf.NewFile(fi) if err != nil { - t.Skip("The system may not support ELF, skipped.") + t.Fatal(err) } section := elfFile.Section(".shstrtab") @@ -316,7 +316,7 @@ func TestElfBindNow(t *testing.T) { elfFile, err := elf.NewFile(fi) if err != nil { - t.Skip("The system may not support ELF, skipped.") + t.Fatal(err) } defer elfFile.Close() @@ -487,7 +487,7 @@ func TestRelroSectionOverlapIssue67261(t *testing.T) { elfFile, err := elf.NewFile(fi) if err != nil { - t.Skip("The system may not support ELF, skipped.") + t.Fatal(err) } defer elfFile.Close() -- 2.52.0