From fd7d9f45dd5abd3b9cff598cffb3b24145d3aaa8 Mon Sep 17 00:00:00 2001 From: Alexander Potapenko Date: Thu, 23 May 2013 09:15:20 +0000 Subject: [PATCH] [ASan] Rename __asan_preinit to __local_asan_preinit to avoid warnings from the linker which is trying to export all the __asan_* symbols llvm-svn: 182567 --- compiler-rt/lib/asan/asan_preinit.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/compiler-rt/lib/asan/asan_preinit.cc b/compiler-rt/lib/asan/asan_preinit.cc index 9de963ccc037..586f551c23c3 100644 --- a/compiler-rt/lib/asan/asan_preinit.cc +++ b/compiler-rt/lib/asan/asan_preinit.cc @@ -18,8 +18,10 @@ // On Linux, we force __asan_init to be called before anyone else // by placing it into .preinit_array section. // FIXME: do we have anything like this on Mac? + // The symbol is called __local_asan_preinit, because it's not intended to be + // exported. __attribute__((section(".preinit_array"), used)) - void (*__asan_preinit)(void) =__asan_init; + void (*__local_asan_preinit)(void) = __asan_init; #elif SANITIZER_WINDOWS && defined(_DLL) // On Windows, when using dynamic CRT (/MD), we can put a pointer // to __asan_init into the global list of C initializers. -- GitLab