This is the mail archive of the gcc-cvs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

r242483 - in /branches/gcc-5-branch/libsanitize...


Author: trippels
Date: Wed Nov 16 11:31:18 2016
New Revision: 242483

URL: https://gcc.gnu.org/viewcvs?rev=242483&root=gcc&view=rev
Log:
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.

See: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78294
and: https://sourceware.org/bugzilla/show_bug.cgi?id=20805

The fix is easy, just add the missing attribute.

  PR sanitizer/78294
  * tsan/tsan_rtl.cc: Add missing attribute.

Modified:
    branches/gcc-5-branch/libsanitizer/ChangeLog
    branches/gcc-5-branch/libsanitizer/tsan/tsan_rtl.cc


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]