[PATCH] Optional support for dynamic Asan runtime

Yury Gribov tetra2005 at gmail.com
Fri Mar 28 12:41:41 PDT 2014



================
Comment at: lib/asan/asan_linux.cc:82
@@ +81,3 @@
+  const char *first_dso_name = 0;
+  dl_iterate_phdr(FindFirstDSOCallback, &first_dso_name);
+  if (first_dso_name && !internal_strstr(first_dso_name, "libclang_rt.asan") &&
----------------
I could probably also use DumpListOfModules here. What's your opinion?

================
Comment at: lib/asan/asan_linux.cc:93
@@ +92,3 @@
+
+void AsanCheckIncompatibleRT() {
+#if !SANITIZER_ANDROID
----------------
I think we can do this:
* for static rt:
** check if dynamic rt in /proc/maps (and die if it's there)
** set __asan_rt_version
* for dynamic rt:
** check __asan_rt_version (and die if it's already initialized by static rt)

But all this looks too complicated compared to current approach (dlsym + preinit allocator).


http://llvm-reviews.chandlerc.com/D3042



More information about the llvm-commits mailing list