From 197a6acb30940068d1dc3d0fa53c9f0863309885 Mon Sep 17 00:00:00 2001 From: Timo VJ Lähde Date: Mon, 5 Apr 2010 01:08:49 +0200 Subject: 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(-) (limited to 'libtcc.c') 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; -- cgit v1.3.1