[PATCH] D40159: Make TLS/NetBSD handling more generic

Kamil Rytarowski via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Nov 19 00:08:17 PST 2017


krytarowski added a comment.

It seems like Linux uses __libc_memalign() interceptor to catch dynamically allocated TLS blocks.

> a thread's static TLS area can be found using the internal glibc function _dl_get_tls_static_info() (like in TSan). On x86 and x86-64 this area includes the thread descriptor, which contains pointers to thread-specific data. On the other hand, dynamically allocated TLS blocks can't always be reached easily through the thread descriptor. We handle them by intercepting the __libc_memalign calls that the linker uses to allocate dynamic TLS space, and considering all blocks allocated from the linker to be live.


Repository:
  rL LLVM

https://reviews.llvm.org/D40159





More information about the llvm-commits mailing list