diff options
Diffstat (limited to 'src/cmd/nm')
| -rw-r--r-- | src/cmd/nm/nm.go | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/cmd/nm/nm.go b/src/cmd/nm/nm.go index 65ef5b4295..457239921b 100644 --- a/src/cmd/nm/nm.go +++ b/src/cmd/nm/nm.go @@ -110,15 +110,19 @@ func nm(file string) { entries := f.Entries() + var found bool + for _, e := range entries { syms, err := e.Symbols() if err != nil { errorf("reading %s: %v", file, err) } if len(syms) == 0 { - errorf("reading %s: no symbols", file) + continue } + found = true + switch *sortOrder { case "address": sort.Slice(syms, func(i, j int) bool { return syms[i].Addr < syms[j].Addr }) @@ -155,5 +159,9 @@ func nm(file string) { } } + if !found { + errorf("reading %s: no symbols", file) + } + w.Flush() } |
