Patchwork [gcov] ignore zero-function objects

login
register
mail settings
Submitter Nathan Sidwell
Date Jan. 11, 2012, 6:53 p.m.
Message ID <4F0DDAA2.5040000@acm.org>
Download mbox | patch
Permalink /patch/135466/
State New
Headers show

Comments

Nathan Sidwell - Jan. 11, 2012, 6:53 p.m.
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

Patch

2012-01-11  Nathan Sidwell  <nathan@acm.org>

	* 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))
     {