Skip to content

Commit

Permalink
cmd/nm: fix TestGoExec on Plan 9
Browse files Browse the repository at this point in the history
CL 115975 changed TestGoExec to check symbol types.
However, this test is failing on Plan 9, because
there is no read-only data segment symbol on Plan 9.

This change fixes TestGoExec to replace the check
of read-only data segment symbol (R) by data segment
symbol (D) on Plan 9.

Fixes golang#25820.

Change-Id: I7164cd9056fa1dfcd1dc1b0f87653290c14c85fa
Reviewed-on: https://go-review.googlesource.com/118035
Run-TryBot: David du Colombier <[email protected]>
Reviewed-by: Brad Fitzpatrick <[email protected]>
TryBot-Result: Gobot Gobot <[email protected]>
  • Loading branch information
0intro committed Jun 11, 2018
1 parent 131d7e0 commit 92f8acd
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/cmd/nm/nm_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,10 @@ func testGoExec(t *testing.T, iscgo, isexternallinker bool) {
t.Errorf("duplicate name of %q is found", name)
}
if stype, found := runtimeSyms[name]; found {
if runtime.GOOS == "plan9" && stype == "R" {
// no read-only data segment symbol on Plan 9
stype = "D"
}
if want, have := stype, strings.ToUpper(f[1]); have != want {
t.Errorf("want %s type for %s symbol, but have %s", want, name, have)
}
Expand Down

0 comments on commit 92f8acd

Please sign in to comment.