From 197a6acb30940068d1dc3d0fa53c9f0863309885 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timo=20VJ=20L=C3=A4hde?= Date: Mon, 5 Apr 2010 01:08:49 +0200 Subject: [PATCH] Avoid a crash with weak symbols for "make test" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Patch from the mailing list by Timo VJ Lähde -- By by ... Detlef --- libtcc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libtcc.c b/libtcc.c index feb30bc..396ba77 100644 --- a/libtcc.c +++ b/libtcc.c @@ -425,7 +425,7 @@ ST_FUNC void put_extern_sym2(Sym *sym, Section *section, if (sym->type.t & VT_STATIC) sym_bind = STB_LOCAL; else { - if (FUNC_WEAK(sym->type.ref->r)) + if (sym->type.ref && FUNC_WEAK(sym->type.ref->r)) sym_bind = STB_WEAK; else sym_bind = STB_GLOBAL;