From owner-p4-projects@FreeBSD.ORG Fri Nov 7 03:40:27 2008 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id DB9961065673; Fri, 7 Nov 2008 03:40:26 +0000 (UTC) Delivered-To: perforce@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A02E9106564A for ; Fri, 7 Nov 2008 03:40:26 +0000 (UTC) (envelope-from peter-gmail@wemm.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id 8FB198FC1B for ; Fri, 7 Nov 2008 03:40:26 +0000 (UTC) (envelope-from peter-gmail@wemm.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.3/8.14.3) with ESMTP id mA73eQ9C074159 for ; Fri, 7 Nov 2008 03:40:26 GMT (envelope-from peter-gmail@wemm.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.14.3/8.14.3/Submit) id mA73eQfG074157 for perforce@freebsd.org; Fri, 7 Nov 2008 03:40:26 GMT (envelope-from peter-gmail@wemm.org) Date: Fri, 7 Nov 2008 03:40:26 GMT Message-Id: <200811070340.mA73eQfG074157@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to peter-gmail@wemm.org using -f From: Peter Wemm To: Perforce Change Reviews Cc: Subject: PERFORCE change 152610 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 07 Nov 2008 03:40:27 -0000 http://perforce.freebsd.org/chv.cgi?CH=152610 Change 152610 by peter@peter_hammer on 2008/11/07 03:40:14 Hack to make size 0 functions sort-of work. m_redir.c will patch them, but the stack tracer will ignore them. This is (sadly) needed on old binaries. Affected files ... .. //depot/projects/valgrind/coregrind/m_debuginfo/readelf.c#5 edit .. //depot/projects/valgrind/coregrind/m_debuginfo/storage.c#4 edit Differences ... ==== //depot/projects/valgrind/coregrind/m_debuginfo/readelf.c#5 (text+ko) ==== @@ -312,7 +312,12 @@ || /* VG_(strlen)(sym_name) == 0 */ /* equivalent but cheaper ... */ sym_name[0] == 0 - || sym->st_size == 0) { +#if !defined(VGO_freebsd) + || sym->st_size == 0 +#else + || (sym->st_size == 0 && ELFXX_ST_TYPE(sym->st_info) != STT_FUNC) +#endif + ) { TRACE_SYMTAB(" ignore -- size=0: %s\n", sym_name); return False; } ==== //depot/projects/valgrind/coregrind/m_debuginfo/storage.c#4 (text+ko) ==== @@ -205,6 +205,10 @@ UInt new_sz, i; DiSym* new_tab; +#if defined(VGO_freebsd) + if (sym->size == 0) + sym->size = 1; +#endif /* Ignore zero-sized syms. */ if (sym->size == 0) return;