summaryrefslogtreecommitdiffstats
path: root/libsanitizer
diff options
context:
space:
mode:
authorjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>2013-02-21 14:25:32 +0000
committerjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>2013-02-21 14:25:32 +0000
commit663891d90ff9a2708a7dc14d55741022856705b8 (patch)
treee528075adf5c6bb529bc8c76e1001beefc6c047d /libsanitizer
parentc856a95f216864a53fc991a954eb3da990233183 (diff)
downloadppe42-gcc-663891d90ff9a2708a7dc14d55741022856705b8.tar.gz
ppe42-gcc-663891d90ff9a2708a7dc14d55741022856705b8.zip
* asan/asan_rtl.cc (__asan_preinit): Don't add if PIC macro is
defined. Add used attribute. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@196205 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libsanitizer')
-rw-r--r--libsanitizer/ChangeLog5
-rw-r--r--libsanitizer/asan/asan_rtl.cc4
2 files changed, 7 insertions, 2 deletions
diff --git a/libsanitizer/ChangeLog b/libsanitizer/ChangeLog
index ed857384853..ece68cbab53 100644
--- a/libsanitizer/ChangeLog
+++ b/libsanitizer/ChangeLog
@@ -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.
diff --git a/libsanitizer/asan/asan_rtl.cc b/libsanitizer/asan/asan_rtl.cc
index e22fcd34fb1..4b0afd2731a 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
OpenPOWER on IntegriCloud