On 11/9/20 6:45 PM, Sebastian Huber wrote:
Hello,

Hello.

There was a similar need some time ago:
https://gcc.gnu.org/legacy-ml/gcc/2019-11/msg00009.html

Please take a look for a possible inspiration.


I would like to use the -ftest-coverage -fprofile-arcs support on a bare metal 
system (no operating system or very early stages in the system startup). In 
this environment I cannot use the gcov info registration via a constructor and 
__gcov_init(), because there may be some other (more complex) constructors 
registered which cannot be called at this stage.. Would it be acceptable to add 
a compiler option which changes the gcov info registration via a constructor to 
a linker set? If enabled, then for each translation unit (see 
coverage_obj_init()) a pointer to the gcov info is placed into a special linker 
section (for example .gcov_info). The linker script collects all .gcov_info 
data and adds a begin/end symbol. The runtime support can then iterate over all 
linker section entries (pointers to struct gcov_info) to dump the aggregated 
gcov data during program termination. Would such changes be acceptable for GCC 
integration or is this too specific?

That's definitely something we can support. Similarly to the linked message, 
are you capable of using
normal system I/O to stream .gcda files?

Martin


Kind regards,

     Sebastian


Reply via email to