From 1c6b6b125eea1de587734ea7b16c05831e91ecf9 Mon Sep 17 00:00:00 2001 From: Carl Shapiro Date: Mon, 28 Jan 2013 15:47:25 -0800 Subject: [PATCH] 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 --- src/cmd/ld/symtab.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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 : ""); } } -- 2.48.1