[PATCH] D40105: Implement GetTls() for NetBSD

Joerg Sonnenberger via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Nov 16 14:24:14 PST 2017


joerg added inline comments.


================
Comment at: lib/sanitizer_common/sanitizer_linux_libcdep.cc:319
 
-#if SANITIZER_FREEBSD
+#if SANITIZER_FREEBSD || SANITIZER_NETBSD
 static void **ThreadSelfSegbase() {
----------------
Please follow ld.elf_so/tls.c here and use _lwp_setprivate/_lwp_settcb for consistent behavior across all platforms.


================
Comment at: lib/sanitizer_common/sanitizer_linux_libcdep.cc:355
 # endif
-#elif SANITIZER_FREEBSD
+#elif SANITIZER_FREEBSD || SANITIZER_NETBSD
   void** segbase = ThreadSelfSegbase();
----------------
It would be better to use struct tls_tcb from sys/tls.h here, avoids having to distinguish variant I and variant II.


Repository:
  rL LLVM

https://reviews.llvm.org/D40105





More information about the llvm-commits mailing list