asan_rtl.cc (__asan_preinit): Don't add if PIC macro is defined.
authorJakub Jelinek <jakub@redhat.com>
Thu, 21 Feb 2013 14:25:32 +0000 (15:25 +0100)
committerJakub Jelinek <jakub@gcc.gnu.org>
Thu, 21 Feb 2013 14:25:32 +0000 (15:25 +0100)
* asan/asan_rtl.cc (__asan_preinit): Don't add if PIC macro is
defined.  Add used attribute.

From-SVN: r196205

libsanitizer/ChangeLog
libsanitizer/asan/asan_rtl.cc

index ed857384853165db124ac3cc434095857b928e7c..ece68cbab53a9aa48c3a480cac7394a9439c4dce 100644 (file)
@@ -1,3 +1,8 @@
+2013-02-21  Jakub Jelinek  <jakub@redhat.com>
+
+       * asan/asan_rtl.cc (__asan_preinit): Don't add if PIC macro is
+       defined.  Add used attribute.
+
 2013-02-21  Kostya Serebryany  <kcc@google.com>
 
        * All source files: Merge from upstream r175733.
index e22fcd34fb12d93f00e98353f3a99c737a38ac1f..4b0afd2731a3f75ed83017331557bfeed4241d7f 100644 (file)
@@ -520,11 +520,11 @@ void __asan_init() {
   }
 }
 
-#if ASAN_USE_PREINIT_ARRAY
+#if ASAN_USE_PREINIT_ARRAY && !defined (PIC)
   // 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?
-  __attribute__((section(".preinit_array")))
+  __attribute__((section(".preinit_array"), used))
   void (*__asan_preinit)(void) =__asan_init;
 #elif defined(_WIN32) && defined(_DLL)
   // On Windows, when using dynamic CRT (/MD), we can put a pointer