On 7/14/2021 1:46 AM, Sebastian Huber wrote:
If the -fprofile-info-section is used, then the gcov information is registered
in a linker set.  This is done by build_gcov_info_var_registration().  The
compiler generated object placed in the section was not marked as referenced,
so once optimization was enabled, this object was optimized away.  Mark it as
referenced.

gcc/
        coverage.c (build_gcov_info_var_registration): Mark the object placed
        in the linker set as referenced so that it does not get optimized away.
OK
jeff

Reply via email to