<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Apr 11, 2018 at 11:31 AM, Chih-Hung Hsieh via Phabricator via llvm-commits <span dir="ltr"><<a href="mailto:llvm-commits@lists.llvm.org" target="_blank">llvm-commits@lists.llvm.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">chh added a comment.<br>
<br>
Yes, calling `__gcov_flush` within .so files are different,<br>
but it's a revert of <a href="https://reviews.llvm.org/D38124" rel="noreferrer" target="_blank">https://reviews.llvm.org/<wbr>D38124</a>.<br>
I think <a href="https://bugs.llvm.org/show_bug.cgi?id=27224" rel="noreferrer" target="_blank">https://bugs.llvm.org/show_<wbr>bug.cgi?id=27224</a><br>
can be fixed by hiding only llvm_gcda_* functions,<br>
without any change to `__gcov_flush`.<br>
<br></blockquote><div><br></div><div>The coverage dumping behavior for shared libraries (not dlopened) was also wrong before D38124. D38124 fixed the crash as well as the dumping bug. </div><div><br></div><div>David </div><div><br></div><div><br></div><div><br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
(1) Before <a href="https://reviews.llvm.org/D38124" rel="noreferrer" target="_blank">https://reviews.llvm.org/<wbr>D38124</a>:<br>
<br>
- Calling `__gcov_flush` within .so or main function dumps to main gcda file.<br>
- Android's dlsym() lookup/call of `__gcov_flush` dumps to .so file specific gcda files.<br>
<br>
(2) After <a href="https://reviews.llvm.org/D38124" rel="noreferrer" target="_blank">https://reviews.llvm.org/<wbr>D38124</a>:<br>
<br>
- Android's dlsym() cannot find/call `__gcov_flush`.<br>
- Calling `__gcov_flush` from main works as in (1).<br>
- Calling `__gcov_flush` from .so works differently; it will dump to .so specific gcda file, not the main one.<br>
<br>
(3) With this change, we revert `__gcov_flush` behavior back to (1).<br>
<br>
Is there any application that needs to call `__gcov_flush` within .so<br>
and expects the output to .so specific gcda file like in (2)?<br>
I think the behavior of (1) is more desirable.<br>
If a main program wants to dump to .so specific gcda file, like Android,<br>
it can use dlsym() to look up .so specific `__gcov_flush`.<br>
<div class="HOEnZb"><div class="h5"><br>
<br>
<a href="https://reviews.llvm.org/D45454" rel="noreferrer" target="_blank">https://reviews.llvm.org/<wbr>D45454</a><br>
<br>
<br>
<br>
______________________________<wbr>_________________<br>
llvm-commits mailing list<br>
<a href="mailto:llvm-commits@lists.llvm.org">llvm-commits@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/<wbr>mailman/listinfo/llvm-commits</a><br>
</div></div></blockquote></div><br></div></div>