Which version fixed intersecting stack and static tls block?
Fangrui Song
maskray@google.com
Tue Jan 5 22:09:03 GMT 2021
I want to remove a piece of code in a compiler-rt (which includes
runtime for sanitizers) patch: https://reviews.llvm.org/D93866
if (!main) {
// If stack and tls intersect, make them non-intersecting.
if (*tls_addr > *stk_addr && *tls_addr < *stk_addr + *stk_size) {
CHECK_GT(*tls_addr + *tls_size, *stk_addr);
CHECK_LE(*tls_addr + *tls_size, *stk_addr + *stk_size);
*stk_size -= *tls_size;
*tls_addr = *stk_addr + *stk_size;
}
}
(The "tls" refers to the static TLS block.
https://sourceware.org/bugzilla/show_bug.cgi?id=16291 is relevant.)
For cross references: https://code.woboq.org/llvm/compiler-rt/lib/sanitizer_common/sanitizer_linux_libcdep.cpp.html#515
The code was committed in the 2012 commit "[tsan] First commit of
ThreadSanitizer (TSan) run-time library." so I suspect the mentioned
glibc issue has long been fixed. If someone knows when this started to
work, it would be of great help: if the fix is new then compiler-rt
should keep the compatibility for a while.
More information about the Libc-alpha
mailing list