]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/link: only run ELF tests on ELF systems
authorIan Lance Taylor <iant@golang.org>
Sat, 31 Jan 2026 03:18:14 +0000 (19:18 -0800)
committerGopher Robot <gobot@golang.org>
Fri, 6 Feb 2026 23:39:54 +0000 (15:39 -0800)
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 <cherryyz@google.com>
Reviewed-by: Michael Knyszek <mknyszek@google.com>
Auto-Submit: Ian Lance Taylor <iant@golang.org>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>

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

index 0b3229e29cff64edc2b81a1bb77ded06f68ece9d..a80ff4a7b3892fdbd3c8f03d4e0f0d739d5d2082 100644 (file)
@@ -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()