From: Jakub Jelinek Date: Thu, 21 Feb 2013 14:25:32 +0000 (+0100) Subject: asan_rtl.cc (__asan_preinit): Don't add if PIC macro is defined. X-Git-Tag: releases/gcc-4.8.0~351 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=4be7da26b58105b8920aeab125a9eb051367ff8f;p=thirdparty%2Fgcc.git 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 --- diff --git a/libsanitizer/ChangeLog b/libsanitizer/ChangeLog index ed8573848531..ece68cbab53a 100644 --- a/libsanitizer/ChangeLog +++ b/libsanitizer/ChangeLog @@ -1,3 +1,8 @@ +2013-02-21 Jakub Jelinek + + * asan/asan_rtl.cc (__asan_preinit): Don't add if PIC macro is + defined. Add used attribute. + 2013-02-21 Kostya Serebryany * All source files: Merge from upstream r175733. diff --git a/libsanitizer/asan/asan_rtl.cc b/libsanitizer/asan/asan_rtl.cc index e22fcd34fb12..4b0afd2731a3 100644 --- a/libsanitizer/asan/asan_rtl.cc +++ b/libsanitizer/asan/asan_rtl.cc @@ -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