[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.
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.



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)
 __gcov_init (struct gcov_info *info)
-  if (!info->version)
+  if (!info->version || !info->n_functions)
   if (gcov_version (info, info->version, 0))