|
From: | markus at trippelsdorf dot de |
Subject: | [Bug gold/20805] New: gcc's ThreadSanitizer broken by gold |
Date: | Fri, 11 Nov 2016 21:05:08 +0000 |
https://sourceware.org/bugzilla/show_bug.cgi?id=20805 Bug ID: 20805 Summary: gcc's ThreadSanitizer broken by gold Product: binutils Version: 2.28 (HEAD) Status: UNCONFIRMED Severity: normal Priority: P2 Component: gold Assignee: ccoutant at gmail dot com Reporter: markus at trippelsdorf dot de CC: ian at airs dot com Target Milestone: --- Created attachment 9624 --> https://sourceware.org/bugzilla/attachment.cgi?id=9624&action=edit testcase When gcc's ThreadSanitizer is linked with gold it crashes all instrumented binaries because of calls to __tls_get_addr. However ThreadSanitizer uses the initial-exec tls model: __attribute__((tls_model("initial-exec"))) extern THREADLOCAL char cur_thread_placeholder[]; INLINE ThreadState *cur_thread() { return reinterpret_cast<ThreadState *>(&cur_thread_placeholder); } So no __tls_get_addr calls should be emitted. For the attached testcase: address@hidden libsanitizer % gcc -fuse-ld=bfd -shared tsan_interceptors.o address@hidden libsanitizer % objdump -dS ./a.out | grep address@hidden address@hidden libsanitizer % gcc -fuse-ld=gold -shared tsan_interceptors.o address@hidden libsanitizer % objdump -dS ./a.out | grep address@hidden | wc -l 779 Also see: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78294 -- You are receiving this mail because: You are on the CC list for the bug.
[Prev in Thread] | Current Thread | [Next in Thread] |