[go] cmd/link: only run ELF tests on ELF systems

4 views
Skip to first unread message

Ian Lance Taylor (Gerrit)

unread,
Jan 30, 2026, 10:19:08 PM (7 days ago) Jan 30
to Cherry Mui, goph...@pubsubhelper.golang.org, Ian Lance Taylor, golang-co...@googlegroups.com
Attention needed from Cherry Mui

Ian Lance Taylor has uploaded the change for review

Ian Lance Taylor would like Cherry Mui to review this change.

Commit message

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

Change diff

diff --git a/src/cmd/link/internal/ld/elf_test.go b/src/cmd/link/internal/ld/elf_test.go
index 0b3229e..65fea5b 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)

package ld

@@ -52,7 +52,7 @@

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 @@

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 @@

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 @@

elfFile, err := elf.NewFile(fi)
if err != nil {
- t.Skip("The system may not support ELF, skipped.")
+ t.Fatal(err)
}
defer elfFile.Close()

Change information

Files:
  • M src/cmd/link/internal/ld/elf_test.go
Change size: S
Delta: 1 file changed, 5 insertions(+), 5 deletions(-)
Open in Gerrit

Related details

Attention is currently required from:
  • Cherry Mui
Submit Requirements:
  • requirement is not satisfiedCode-Review
  • requirement satisfiedNo-Unresolved-Comments
  • requirement is not satisfiedReview-Enforcement
  • requirement is not satisfiedTryBots-Pass
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: newchange
Gerrit-Project: go
Gerrit-Branch: master
Gerrit-Change-Id: I318fb5c2de9e4cfdb976bc2389c72cede6661b47
Gerrit-Change-Number: 740782
Gerrit-PatchSet: 1
Gerrit-Owner: Ian Lance Taylor <ia...@golang.org>
Gerrit-Reviewer: Cherry Mui <cher...@google.com>
Gerrit-Reviewer: Ian Lance Taylor <ia...@golang.org>
Gerrit-Attention: Cherry Mui <cher...@google.com>
unsatisfied_requirement
satisfied_requirement
open
diffy

Cherry Mui (Gerrit)

unread,
Feb 5, 2026, 4:03:50 PM (2 days ago) Feb 5
to Ian Lance Taylor, goph...@pubsubhelper.golang.org, Go LUCI, golang-co...@googlegroups.com
Attention needed from Ian Lance Taylor

Cherry Mui voted and added 1 comment

Votes added by Cherry Mui

Code-Review+2

1 comment

File src/cmd/link/internal/ld/elf_test.go
Line 5, Patchset 4 (Latest)://go:build cgo && (dragonfly || freebsd || linux || netbsd || openbsd)
Cherry Mui . unresolved

solaris is also ELF, right?

Open in Gerrit

Related details

Attention is currently required from:
  • Ian Lance Taylor
Submit Requirements:
  • requirement satisfiedCode-Review
  • requirement is not satisfiedNo-Unresolved-Comments
  • requirement is not satisfiedReview-Enforcement
  • requirement satisfiedTryBots-Pass
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: go
Gerrit-Branch: master
Gerrit-Change-Id: I318fb5c2de9e4cfdb976bc2389c72cede6661b47
Gerrit-Change-Number: 740782
Gerrit-PatchSet: 4
Gerrit-Owner: Ian Lance Taylor <ia...@golang.org>
Gerrit-Reviewer: Cherry Mui <cher...@google.com>
Gerrit-Reviewer: Ian Lance Taylor <ia...@golang.org>
Gerrit-Attention: Ian Lance Taylor <ia...@golang.org>
Gerrit-Comment-Date: Thu, 05 Feb 2026 21:03:46 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
satisfied_requirement
unsatisfied_requirement
open
diffy

Ian Lance Taylor (Gerrit)

unread,
Feb 5, 2026, 6:08:39 PM (2 days ago) Feb 5
to Ian Lance Taylor, goph...@pubsubhelper.golang.org, golang-co...@googlegroups.com
Attention needed from Ian Lance Taylor

Ian Lance Taylor uploaded new patchset

Ian Lance Taylor uploaded patch set #5 to this change.
Following approvals got outdated and were removed:
  • TryBots-Pass: LUCI-TryBot-Result+1 by Go LUCI
Open in Gerrit

Related details

Attention is currently required from:
  • Ian Lance Taylor
Submit Requirements:
    • requirement satisfiedCode-Review
    • requirement is not satisfiedNo-Unresolved-Comments
    • requirement is not satisfiedReview-Enforcement
    • requirement is not satisfiedTryBots-Pass
    Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
    Gerrit-MessageType: newpatchset
    Gerrit-Project: go
    Gerrit-Branch: master
    Gerrit-Change-Id: I318fb5c2de9e4cfdb976bc2389c72cede6661b47
    Gerrit-Change-Number: 740782
    Gerrit-PatchSet: 5
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Ian Lance Taylor (Gerrit)

    unread,
    Feb 5, 2026, 6:09:30 PM (2 days ago) Feb 5
    to Ian Lance Taylor, goph...@pubsubhelper.golang.org, Cherry Mui, Go LUCI, golang-co...@googlegroups.com

    Ian Lance Taylor voted and added 1 comment

    Votes added by Ian Lance Taylor

    Commit-Queue+1

    1 comment

    File src/cmd/link/internal/ld/elf_test.go
    Line 5, Patchset 4://go:build cgo && (dragonfly || freebsd || linux || netbsd || openbsd)
    Cherry Mui . resolved

    solaris is also ELF, right?

    Ian Lance Taylor

    True. I just copied the build constraint from cmd/link/elf_test.go. Added Solaris. Followup CL will Solaris to the other file.

    Open in Gerrit

    Related details

    Attention set is empty
    Submit Requirements:
    • requirement satisfiedCode-Review
    • requirement satisfiedNo-Unresolved-Comments
    • requirement is not satisfiedReview-Enforcement
    • requirement is not satisfiedTryBots-Pass
    Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
    Gerrit-MessageType: comment
    Gerrit-Project: go
    Gerrit-Branch: master
    Gerrit-Change-Id: I318fb5c2de9e4cfdb976bc2389c72cede6661b47
    Gerrit-Change-Number: 740782
    Gerrit-PatchSet: 5
    Gerrit-Owner: Ian Lance Taylor <ia...@golang.org>
    Gerrit-Reviewer: Cherry Mui <cher...@google.com>
    Gerrit-Reviewer: Ian Lance Taylor <ia...@golang.org>
    Gerrit-Comment-Date: Thu, 05 Feb 2026 23:09:26 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: Yes
    Comment-In-Reply-To: Cherry Mui <cher...@google.com>
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Michael Knyszek (Gerrit)

    unread,
    Feb 6, 2026, 12:38:03 PM (13 hours ago) Feb 6
    to Ian Lance Taylor, goph...@pubsubhelper.golang.org, Go LUCI, Cherry Mui, golang-co...@googlegroups.com
    Attention needed from Ian Lance Taylor

    Michael Knyszek voted Code-Review+1

    Code-Review+1
    Open in Gerrit

    Related details

    Attention is currently required from:
    • Ian Lance Taylor
    Submit Requirements:
      • requirement satisfiedCode-Review
      • requirement satisfiedNo-Unresolved-Comments
      • requirement satisfiedReview-Enforcement
      • requirement satisfiedTryBots-Pass
      Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
      Gerrit-MessageType: comment
      Gerrit-Project: go
      Gerrit-Branch: master
      Gerrit-Change-Id: I318fb5c2de9e4cfdb976bc2389c72cede6661b47
      Gerrit-Change-Number: 740782
      Gerrit-PatchSet: 5
      Gerrit-Owner: Ian Lance Taylor <ia...@golang.org>
      Gerrit-Reviewer: Cherry Mui <cher...@google.com>
      Gerrit-Reviewer: Ian Lance Taylor <ia...@golang.org>
      Gerrit-Reviewer: Michael Knyszek <mkny...@google.com>
      Gerrit-Attention: Ian Lance Taylor <ia...@golang.org>
      Gerrit-Comment-Date: Fri, 06 Feb 2026 17:37:59 +0000
      Gerrit-HasComments: No
      Gerrit-Has-Labels: Yes
      satisfied_requirement
      open
      diffy

      Ian Lance Taylor (Gerrit)

      unread,
      Feb 6, 2026, 6:37:46 PM (7 hours ago) Feb 6
      to Ian Lance Taylor, goph...@pubsubhelper.golang.org, Go LUCI, Cherry Mui, golang-co...@googlegroups.com

      Ian Lance Taylor voted Auto-Submit+1

      Auto-Submit+1
      Open in Gerrit

      Related details

      Attention set is empty
      Submit Requirements:
      • requirement satisfiedCode-Review
      • requirement satisfiedNo-Unresolved-Comments
      • requirement satisfiedReview-Enforcement
      • requirement satisfiedTryBots-Pass
      Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
      Gerrit-MessageType: comment
      Gerrit-Project: go
      Gerrit-Branch: master
      Gerrit-Change-Id: I318fb5c2de9e4cfdb976bc2389c72cede6661b47
      Gerrit-Change-Number: 740782
      Gerrit-PatchSet: 5
      Gerrit-Owner: Ian Lance Taylor <ia...@golang.org>
      Gerrit-Reviewer: Cherry Mui <cher...@google.com>
      Gerrit-Reviewer: Ian Lance Taylor <ia...@golang.org>
      Gerrit-Reviewer: Michael Knyszek <mkny...@google.com>
      Gerrit-Comment-Date: Fri, 06 Feb 2026 23:37:41 +0000
      Gerrit-HasComments: No
      Gerrit-Has-Labels: Yes
      satisfied_requirement
      open
      diffy

      Gopher Robot (Gerrit)

      unread,
      Feb 6, 2026, 6:39:59 PM (7 hours ago) Feb 6
      to Ian Lance Taylor, goph...@pubsubhelper.golang.org, golang-...@googlegroups.com, Michael Knyszek, Go LUCI, Cherry Mui, golang-co...@googlegroups.com

      Gopher Robot submitted the change with unreviewed changes

      Unreviewed changes

      4 is the latest approved patch-set.
      The change was submitted with unreviewed changes in the following files:

      ```
      The name of the file: src/cmd/link/internal/ld/elf_test.go
      Insertions: 1, Deletions: 1.


      @@ -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 && (dragonfly || freebsd || linux || netbsd || openbsd)
      +//go:build cgo && (dragonfly || freebsd || linux || netbsd || openbsd || solaris)

      package ld

      ```

      Change information

      Commit message:
      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-by: Cherry Mui <cher...@google.com>
      Reviewed-by: Michael Knyszek <mkny...@google.com>
      Auto-Submit: Ian Lance Taylor <ia...@golang.org>
      Files:
      • M src/cmd/link/internal/ld/elf_test.go
      Change size: S
      Delta: 1 file changed, 5 insertions(+), 5 deletions(-)
      Branch: refs/heads/master
      Submit Requirements:
      • requirement satisfiedCode-Review: +2 by Cherry Mui, +1 by Michael Knyszek
      • requirement satisfiedTryBots-Pass: LUCI-TryBot-Result+1 by Go LUCI
      Open in Gerrit
      Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
      Gerrit-MessageType: merged
      Gerrit-Project: go
      Gerrit-Branch: master
      Gerrit-Change-Id: I318fb5c2de9e4cfdb976bc2389c72cede6661b47
      Gerrit-Change-Number: 740782
      Gerrit-PatchSet: 6
      Gerrit-Owner: Ian Lance Taylor <ia...@golang.org>
      Gerrit-Reviewer: Cherry Mui <cher...@google.com>
      Gerrit-Reviewer: Gopher Robot <go...@golang.org>
      open
      diffy
      satisfied_requirement
      Reply all
      Reply to author
      Forward
      0 new messages