[PATCH] D45454: Make __gcov_flush visible outside a shared library

Chih-Hung Hsieh via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Apr 10 15:24:46 PDT 2018


chh added a comment.

If we use the unit test case, call `__gcov_flush` from the main function,
and dump static variables in GCDAProfiling.c, we can see that `__gcov_flush`
is resolved to the same copy for func.shared, func2.shared, and main.
However, when `__gcov_flush` is called from main and from f1_flush and f2_flush,
they use different copies of static variables defined in GCDAProfiling.c.
The "flush_fn_head" and its flush functions are different, so 3 calls of
`__gcov_flush` will flush to 3 different output files:

  instrprof-dlopen-func.gcda
  instrprof-dlopen-func2.gcda
  instrprof-dlopen-dlclose-main.gcda

This keeps current Android use cases working as before `__gcov_flush` is hidden.
Is there other use case that could be broken by this change?


https://reviews.llvm.org/D45454





More information about the cfe-commits mailing list