diff mbox

[gcov] ignore zero-function objects

Message ID 4F0DDAA2.5040000@acm.org
State New
Headers show

Commit Message

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

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