This is the mail archive of the
mailing list for the GCC project.
r242480 - in /trunk/libsanitizer: ChangeLog tsa...
- From: trippels at gcc dot gnu dot org
- To: gcc-cvs at gcc dot gnu dot org
- Date: Wed, 16 Nov 2016 11:21:42 -0000
- Subject: r242480 - in /trunk/libsanitizer: ChangeLog tsa...
Date: Wed Nov 16 11:21:42 2016
New Revision: 242480
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.