On 08/10/2016 02:53 PM, Nathan Sidwell wrote: > On 08/10/16 06:43, Martin Liška wrote: >> Hello. >> >> There are multiple PRs (mentioned in ChangeLog) which suffer from missing >> capability of gcov >> to save counters for functions with constructor/destructor attributes. I >> done that by simply >> replacing atexit handler (gcov_exit) with a new static destructor >> (__gcov_exit), which has >> priority 99 (I did the same for __gcov_init). However, I'm not sure whether >> it's possible >> that a ctor defined in a source file can be potentially executed before >> __gcov_init (w/ the default >> priority)? >> >> Patch survives: >> make check -k -j10 RUNTESTFLAGS="gcov.exp" >> make check -k -j10 RUNTESTFLAGS="tree-prof.exp" >> >> I've just also verified that a DSO gcov dump works as before. I'm attaching >> a test-case which >> tests both static ctors/dtors, as well as C++ ctors/dtors. > > Does a coverage bootstrap (--enable-coverage) still succeed?
Well, looks results are more unstable than I thought. Even running 'make -j1' in objdir/x86_64-pc-linux-gnu/libgcc repeatedly generates different results. I'll dig in after weekend. Martin > > I think this is a good idea, but we should document the changed behavior. (I > don't think the current behaviour's documented). > > > nathan