From: Carl Shapiro Date: Mon, 28 Jan 2013 23:47:25 +0000 (-0800) Subject: cmd/ld: avoid a segfault when dumping the symbol table X-Git-Tag: go1.1rc2~1271 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=1c6b6b125eea1de587734ea7b16c05831e91ecf9;p=gostls13.git 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 --- diff --git a/src/cmd/ld/symtab.c b/src/cmd/ld/symtab.c index 4b83e36b01..87b72659b1 100644 --- a/src/cmd/ld/symtab.c +++ b/src/cmd/ld/symtab.c @@ -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 : ""); } }