gcov: Add -fprofile-info-section support
Register the profile information in the specified section instead of using a
constructor/destructor. A pointer to the profile information generated by
-fprofile-arcs or -ftest-coverage is placed in the specified section for each
translation unit. This option disables the profile information registration
through a constructor and it disables the profile information processing
through a destructor.
I am not sure how I can test this option. One approach would be to assemble a
test file, then scan it and check that a .gcov_info section is present and no
__gcov_init() and __gcov_exit() calls are present. Is there an example for
this in the test suite?
gcc/
* common.opt (fprofile-info-section): New.
* coverage.c (build_gcov_info_var_registration): New.
(coverage_obj_init): Evaluate profile_info_section and use
build_gcov_info_var_registration().
* doc/invoke.texi (fprofile-info-section): Document.
* opts.c (common_handle_option): Process fprofile-info-section
option.
gcc/testsuite/ChangeLog:
* gcc.dg/profile-info-section.c: New test.