1
0
mirror of https://github.com/golang/go synced 2024-11-18 15:54:42 -07:00

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
This commit is contained in:
Carl Shapiro 2013-01-28 15:47:25 -08:00
parent 3c51a69937
commit 1c6b6b125e

View File

@ -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 : "");
}
}