[PATCH] D45454: Add llvm_gcov_flush to be called outside a shared library

Chih-Hung Hsieh via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jun 29 14:26:30 PDT 2018


chh added inline comments.


================
Comment at: test/profile/Inputs/instrprof-dlopen-dlclose-main.c:20
+  void (*gcov_flush)() = (void (*)())dlsym(f1_handle, "__gcov_flush");
+  if (gcov_flush != NULL) {
+    fprintf(stderr, "__gcov_flush should not be visible in func.shared'\n");
----------------
srhines wrote:
> Should also clear dlerror() before this call and check that dlerror() returned a non-NULL pointer indicating that this search failed.
Look up of __gcov_flush is expected to fail because it's hidden.
Other places checks for returned value and report dlerror() messages.



https://reviews.llvm.org/D45454





More information about the llvm-commits mailing list