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

Chih-Hung Hsieh via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Apr 11 11:31:20 PDT 2018


chh added a comment.

Yes, calling `__gcov_flush` within .so files are different,
but it's a revert of https://reviews.llvm.org/D38124.
I think  https://bugs.llvm.org/show_bug.cgi?id=27224
can be fixed by hiding only llvm_gcda_* functions,
without any change to `__gcov_flush`.

(1) Before https://reviews.llvm.org/D38124:

- Calling `__gcov_flush` within .so or main function dumps to main gcda file.
- Android's dlsym() lookup/call of `__gcov_flush` dumps to .so file specific gcda files.

(2) After https://reviews.llvm.org/D38124:

- Android's dlsym() cannot find/call `__gcov_flush`.
- Calling `__gcov_flush` from main works as in (1).
- Calling `__gcov_flush` from .so works differently; it will dump to .so specific gcda file, not the main one.

(3) With this change, we revert `__gcov_flush` behavior back to (1).

Is there any application that needs to call `__gcov_flush` within .so
and expects the output to .so specific gcda file like in (2)?
I think the behavior of (1) is more desirable.
If a main program wants to dump to .so specific gcda file, like Android,
it can use dlsym() to look up .so specific `__gcov_flush`.


https://reviews.llvm.org/D45454





More information about the cfe-commits mailing list