If a test program uses _exit in lieu of exit, the end-user must call __gcov_flush. Unfortunately this API isn't currently exposed anywhere, so calling it isn't possible unless someone adds appropriate extern's in program headers. It would be really nice if this API was exposed so others didn't need to back a __gcov_flush definition in their sources (this seems to be the hack that multiple individuals are using to workaround __gcov_flush not being made public via binutils :(, e.g., https://gcc.gnu.org/ml/gcc-help/2015-06/msg00135.html ). The companion bug I filed for this on the LLVM side can be found here: http://bugs.llvm.org/show_bug.cgi?id=32555 .
Thanks for report, I'll take a look.
Created attachment 41211 [details] Untested patch
The patch is preapproved (for release branch, too, assuming that RMs agree). Thanks!
Author: marxin Date: Wed Apr 19 08:08:44 2017 New Revision: 246990 URL: https://gcc.gnu.org/viewcvs?rev=246990&root=gcc&view=rev Log: Introduce gcov.h header file (PR gcov-profile/80435). 2017-04-19 Martin Liska <mliska@suse.cz> PR gcov-profile/80435 * Makefile.in: Install gcov.h. * gcov.h: New file. * libgcov.h: Use the header and make __gcov_flush publicly visible. Added: trunk/libgcc/gcov.h Modified: trunk/libgcc/ChangeLog trunk/libgcc/Makefile.in trunk/libgcc/libgcov.h
Fixed on trunk, queued for active branches.
Fixed.