diff options
author | Carl Shapiro <cshapiro@google.com> | 2013-01-28 15:47:25 -0800 |
---|---|---|
committer | Carl Shapiro <cshapiro@google.com> | 2013-01-28 15:47:25 -0800 |
commit | f61a6bceca6aa96e0b454d553fea8db281a0ad4a (patch) | |
tree | e419cf7267b0dd0e3f7f94513bb39a3cf8a19583 /src | |
parent | deb647ec7a54d1b2f745ddee5873e948d99c6d01 (diff) | |
download | go-f61a6bceca6aa96e0b454d553fea8db281a0ad4a.tar.gz |
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://codereview.appspot.com/7224043
Diffstat (limited to 'src')
-rw-r--r-- | src/cmd/ld/symtab.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/cmd/ld/symtab.c b/src/cmd/ld/symtab.c index 4b83e36b0..87b72659b 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 : ""); } } |