GCC 5.x libgcov: gcov_exit() and .gcda-writeout-code removed?

Asked by Lothar Stolz on 2016-02-22


We previously used arm-none-eabi 4.9 and, for convenient debugging and code quality assurance during development, used libgcov together with ARM semihosting enabled (with librdimon/full newlib).

However, after doing the upgrade to GCC 5.x we observed that lots of features have been removed from libgcov (size now 20k instead of 40k) The well-known entry-point gcov_exit() as well as code for writing out the coverage-dump seem to have been removed (as there are no more references to any external file IO functions from newlib in the "libgcov.a"-file).

What's the reason behind stripping down libgcov this way, is there another proposed mechanism for using this very important gcov-feature now with GCC 5.x?

Best regards,
Lothar Stolz (WITTENSTEIN electronics)

Question information

English Edit question
GNU Arm Embedded Toolchain Edit question
No assignee Edit question
Solved by:
Tejas Belagod
Last query:
Last reply:
Revision history for this message
Tejas Belagod (belagod-tejas) said :

Thanks for reporting this. We are looking into this and will get back with an answer soon.

Revision history for this message
Tejas Belagod (belagod-tejas) said :

This patch here https://gcc.gnu.org/ml/gcc-patches/2014-08/msg00739.html seems to have retired gcov_exit() public interface. I will have a more comprehensive answer for you soon.

Revision history for this message
Lothar Stolz (lothar-stolz) said :

Hi and thanks a lot for your answers!

In the meantime, are there any new information on this topic? I'm asking again because we probably will have to start soon to do a custom dirty hack to make the gcov work again, and I'd like to prevent such a hack from happening in favour of a clean, officially supported solution. Or, maybe then, is there a way of contributing for reestablishing gcov-support?

Revision history for this message
Andre Vieira (andre-simoesdiasvieira) said :

Hi Lothar,

For some reason https://gcc.gnu.org/ml/gcc-patches/2015-10/msg02424.html never made it into trunk. I have tested this patch on top of embedded-5-branch and it seems to populate libgcov again.

We will be chasing this upstream and in the meantime we committed this patch to the embedded-5-branch which will thus be included in our next release.


Revision history for this message
Best Tejas Belagod (belagod-tejas) said :

Hi Lothar,

This should be fixed in https://launchpad.net/gcc-arm-embedded/5.0/5-2016-q1-update.


Revision history for this message
Lothar Stolz (lothar-stolz) said :

Hi Tejas,

Thanks very much! Tested it and all seems to work fine again :-) Since gcov_exit() isn't exported, for triggering off the coverage Information dump, legacy applications now seem to have to be slightly modified to do a call to __gcov_flush() instead.

Thanks again & best regards,

Revision history for this message
Lothar Stolz (lothar-stolz) said :

Thanks Tejas Belagod, that solved my question.