[PATCH] D43669: [cfi] Lazy CFI initialization

Evgenii Stepanov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Feb 23 11:28:29 PST 2018


eugenis added inline comments.


================
Comment at: compiler-rt/lib/cfi/cfi.cc:426
 void __cfi_init() {
+  BlockingMutexLock lock(&cfi_init_lock);
+  if (cfi_inited)
----------------
This mutex is not very useful. An interceptor could still go ahead while __cfi_init is running in another thread. And we probably can not afford a lock in __cfi_slowpath.

Perhaps add a constructor to all cfi-instrumented binaries? Then we would not need lazy initialization in __cfi_slowpath, and I don't care how many locks dlopen() takes.


https://reviews.llvm.org/D43669





More information about the llvm-commits mailing list