From 4ceacc59b3353cc3be01b2416b32614274425dd2 Mon Sep 17 00:00:00 2001 From: simonmar Date: Thu, 1 Feb 2001 12:37:44 +0000 Subject: [PATCH] [project @ 2001-02-01 12:37:44 by simonmar] fix problems with unloadObj --- ghc/rts/Linker.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/ghc/rts/Linker.c b/ghc/rts/Linker.c index bbfdc37..90b0ab1 100644 --- a/ghc/rts/Linker.c +++ b/ghc/rts/Linker.c @@ -1,5 +1,5 @@ /* ----------------------------------------------------------------------------- - * $Id: Linker.c,v 1.15 2001/01/29 17:23:41 simonmar Exp $ + * $Id: Linker.c,v 1.16 2001/02/01 12:37:44 simonmar Exp $ * * (c) The GHC Team, 2000 * @@ -474,7 +474,9 @@ unloadObj( char *path ) { SymbolVal *s; for (s = oc->symbols; s < oc->symbols + oc->n_symbols; s++) { - removeStrHashTable(symhash, s->lbl, NULL); + if (s->lbl != NULL) { + removeStrHashTable(symhash, s->lbl, NULL); + } } } @@ -1359,6 +1361,7 @@ ocGetNames_ELF ( ObjectCode* oc ) stab = (Elf32_Sym*) (ehdrC + shdr[i].sh_offset); nent = shdr[i].sh_size / sizeof(Elf32_Sym); oc->symbols = malloc(nent * sizeof(SymbolVal)); + oc->n_symbols = nent; for (j = 0; j < nent; j++) { if ( ( ELF32_ST_BIND(stab[j].st_info)==STB_GLOBAL /* || ELF32_ST_BIND(stab[j].st_info)==STB_LOCAL */ -- 1.7.10.4