From patchwork Wed Jan 11 18:53:22 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nathan Sidwell X-Patchwork-Id: 135466 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) by ozlabs.org (Postfix) with SMTP id 6A58FB6EE6 for ; Thu, 12 Jan 2012 05:53:42 +1100 (EST) Comment: DKIM? See http://www.dkim.org DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=gcc.gnu.org; s=default; x=1326912823; h=Comment: DomainKey-Signature:Received:Received:Received:Received:Received: Received:Received:Message-ID:Date:From:User-Agent:MIME-Version: To:Subject:Content-Type:Mailing-List:Precedence:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:Sender: Delivered-To; bh=7T9xGShTc5Ixk9YNAOm9sPm5yg8=; b=Mi8/d8AY5Qr+I+9 dUGhQeBkjyJAJAQkwJndSpNJYPcaBVG51I7cWik/hCvZtjlwOZS4+Kl/C1ndFeip 2C92abGsjqp2AsZfxULD0BRamXJlnjR83Sw4z4mPOe1ktg1+dKzlJeA1oSwoKVSa Evw9g56wbzBmZjhxkQy45V7/0prg= Comment: DomainKeys? See http://antispam.yahoo.com/domainkeys DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=default; d=gcc.gnu.org; h=Received:Received:X-SWARE-Spam-Status:X-Spam-Check-By:Received:Received:Received:Received:Received:Message-ID:Date:From:User-Agent:MIME-Version:To:Subject:Content-Type:X-IsSubscribed:Mailing-List:Precedence:List-Id:List-Unsubscribe:List-Archive:List-Post:List-Help:Sender:Delivered-To; b=GfU42nJ5PTzSBlk3TprcDk8zMYxfGwRJlbRaqHd7ryJdcMLjPiTjesk6Niy52K OJZgEltf6ACVvrijDX2qKxG9KxqezXtvJUDalgvRd4sgp24X5ByxV3+PfbZIW4Mh OQlCgJdL7lR+V5VWrfwNlnYZ8dsq266obJ98iQ46zSWzI=; Received: (qmail 8687 invoked by alias); 11 Jan 2012 18:53:39 -0000 Received: (qmail 8679 invoked by uid 22791); 11 Jan 2012 18:53:38 -0000 X-SWARE-Spam-Status: No, hits=-2.5 required=5.0 tests=AWL, BAYES_00, RCVD_IN_DNSWL_LOW X-Spam-Check-By: sourceware.org Received: from mail-we0-f175.google.com (HELO mail-we0-f175.google.com) (74.125.82.175) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 11 Jan 2012 18:53:25 +0000 Received: by werm13 with SMTP id m13so916721wer.20 for ; Wed, 11 Jan 2012 10:53:24 -0800 (PST) Received: by 10.216.139.102 with SMTP id b80mr3234628wej.27.1326308004627; Wed, 11 Jan 2012 10:53:24 -0800 (PST) Received: by 10.216.139.102 with SMTP id b80mr3234621wej.27.1326308004554; Wed, 11 Jan 2012 10:53:24 -0800 (PST) Received: from [192.168.44.102] (5ac3c85d.bb.sky.com. [90.195.200.93]) by mx.google.com with ESMTPS id g26sm2770627wbo.16.2012.01.11.10.53.23 (version=SSLv3 cipher=OTHER); Wed, 11 Jan 2012 10:53:23 -0800 (PST) Message-ID: <4F0DDAA2.5040000@acm.org> Date: Wed, 11 Jan 2012 18:53:22 +0000 From: Nathan Sidwell User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.24) Gecko/20111108 Lightning/1.0b2 Thunderbird/3.1.16 MIME-Version: 1.0 To: GCC Patches Subject: [gcov] ignore zero-function objects X-IsSubscribed: yes Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org I've committed this patch so that libgcov ignores object with no functions. Such objects can occur when it turns out that none of the instrumented functions were emitted -- the translation unit ends up with just data objects. nathan 2012-01-11 Nathan Sidwell * libgcov.c (__gcov_init): Ignore objects with no functions. Index: libgcov.c =================================================================== --- libgcov.c (revision 183102) +++ libgcov.c (working copy) @@ -686,10 +686,14 @@ gcov_exit (void) void __gcov_init (struct gcov_info *info) { - if (!info->version) + if (!info->version || !info->n_functions) return; if (gcov_version (info, info->version, 0)) {