aboutsummaryrefslogtreecommitdiff
path: root/src/debug
diff options
context:
space:
mode:
authorMichael Hudson-Doyle <michael.hudson@canonical.com>2015-02-18 14:58:13 +1300
committerIan Lance Taylor <iant@golang.org>2015-04-10 23:53:43 +0000
commit8bf0ed5147a95434a0204174b077fe71acc4b432 (patch)
tree574b4f32577dce8ea3fba52a534f0b1e40b79d15 /src/debug
parent0eadcc886e15dbd8536bb1f3450fa02f53ceeee3 (diff)
downloadgo-8bf0ed5147a95434a0204174b077fe71acc4b432.tar.xz
debug/gosym: skip tests when .gosymtab section not found
Skip the test when there is no .gosymtab section in the executable rather than crashing. Change-Id: Ieb3df07e307f50c33cdafab38f9b5d1ac0e55c04 Reviewed-on: https://go-review.googlesource.com/5110 Reviewed-by: Russ Cox <rsc@golang.org> Run-TryBot: Michael Hudson-Doyle <michael.hudson@canonical.com>
Diffstat (limited to 'src/debug')
-rw-r--r--src/debug/gosym/pclntab_test.go6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/debug/gosym/pclntab_test.go b/src/debug/gosym/pclntab_test.go
index 1415fac276..6855a65bbe 100644
--- a/src/debug/gosym/pclntab_test.go
+++ b/src/debug/gosym/pclntab_test.go
@@ -84,7 +84,11 @@ func crack(file string, t *testing.T) (*elf.File, *Table) {
}
func parse(file string, f *elf.File, t *testing.T) (*elf.File, *Table) {
- symdat, err := f.Section(".gosymtab").Data()
+ s := f.Section(".gosymtab")
+ if s == nil {
+ t.Skip("no .gosymtab section")
+ }
+ symdat, err := s.Data()
if err != nil {
f.Close()
t.Fatalf("reading %s gosymtab: %v", file, err)