Commit 1c6b6b12 authored by Carl Shapiro's avatar Carl Shapiro

cmd/ld: avoid a segfault when dumping the symbol table

The dumping routine incorrectly assumed that all incoming
symbols would be non-nil and load through it to retrieve the
symbol name.  Instead of using the symbol to retrieve a name,
use the name provided by the caller.

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/7224043
parent 3c51a699
......@@ -367,9 +367,9 @@ putsymb(Sym *s, char *name, int t, vlong v, vlong size, int ver, Sym *typ)
return;
}
if(ver)
Bprint(&bso, "%c %.8llux %s<%d> %s\n", t, v, s->name, ver, typ ? typ->name : "");
Bprint(&bso, "%c %.8llux %s<%d> %s\n", t, v, name, ver, typ ? typ->name : "");
else
Bprint(&bso, "%c %.8llux %s %s\n", t, v, s->name, typ ? typ->name : "");
Bprint(&bso, "%c %.8llux %s %s\n", t, v, name, typ ? typ->name : "");
}
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment