This is the mail archive of the
mailing list for the GCC project.
r242482 - in /branches/gcc-6-branch/libsanitize...
- From: trippels at gcc dot gnu dot org
- To: gcc-cvs at gcc dot gnu dot org
- Date: Wed, 16 Nov 2016 11:28:58 -0000
- Subject: r242482 - in /branches/gcc-6-branch/libsanitize...
Date: Wed Nov 16 11:28:57 2016
New Revision: 242482
Fix PR78294 - thread sanitizer broken when using ld.gold
When one uses ld.gold to build gcc, the thread sanitizer doesn't work,
because gold is more conservative when applying TLS relaxations than
ld.bfd. In this case a missing initial-exec attribute on a declaration
causes gcc to assume the general dynamic model. With ld.bfd this gets
relaxed to initial exec when linking the shared library, so the missing
attribute doesn't matter. But ld.gold doesn't perform this optimization
and this leads to crashes on tsan instrumented binaries.
The fix is easy, just add the missing attribute.
* tsan/tsan_rtl.cc: Add missing attribute.