This is the mail archive of the
mailing list for the GCC project.
r242483 - in /branches/gcc-5-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:31:18 -0000
- Subject: r242483 - in /branches/gcc-5-branch/libsanitize...
Date: Wed Nov 16 11:31:18 2016
New Revision: 242483
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.