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:
markus@x4 libsanitizer % gcc -fuse-ld=bfd -shared tsan_interceptors.o
markus@x4 libsanitizer % objdump -dS ./a.out | grep __tls_get_addr@plt
markus@x4 libsanitizer % gcc -fuse-ld=gold -shared tsan_interceptors.o
markus@x4 libsanitizer % objdump -dS ./a.out | grep __tls_get_addr@plt | 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.
_______________________________________________
bug-binutils mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/bug-binutils