asan_rtl.cc (__asan_preinit): Don't add if PIC macro is defined.

* asan/asan_rtl.cc (__asan_preinit): Don't add if PIC macro is
	defined.  Add used attribute.

From-SVN: r196205
This commit is contained in:
Jakub Jelinek 2013-02-21 15:25:32 +01:00 committed by Jakub Jelinek
parent c0da9c377c
commit 4be7da26b5
2 changed files with 7 additions and 2 deletions

View 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.

View 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