[PATCH] D48255: [sanitizer] Fix LSAN for 32-bit glibc before 2.27

Peter Wu via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sat Jun 16 03:18:13 PDT 2018


Lekensteyn updated this revision to Diff 151615.
Lekensteyn added a comment.

Oops, wrong (unsplit) diff. This is the correct one and depends on https://reviews.llvm.org/D48254.


https://reviews.llvm.org/D48255

Files:
  lib/sanitizer_common/sanitizer_linux_libcdep.cc


Index: lib/sanitizer_common/sanitizer_linux_libcdep.cc
===================================================================
--- lib/sanitizer_common/sanitizer_linux_libcdep.cc
+++ lib/sanitizer_common/sanitizer_linux_libcdep.cc
@@ -185,11 +185,7 @@
 static uptr g_tls_size;
 
 #ifdef __i386__
-# ifndef __GLIBC_PREREQ
-#  define CHECK_GET_TLS_STATIC_INFO_VERSION 1
-# else
-#  define CHECK_GET_TLS_STATIC_INFO_VERSION (!__GLIBC_PREREQ(2, 27))
-# endif
+# define CHECK_GET_TLS_STATIC_INFO_VERSION 1
 #else
 # define CHECK_GET_TLS_STATIC_INFO_VERSION 0
 #endif
@@ -227,8 +223,7 @@
   // On i?86, _dl_get_tls_static_info used to be internal_function, i.e.
   // __attribute__((regparm(3), stdcall)) before glibc 2.27 and is normal
   // function in 2.27 and later.
-  if (CHECK_GET_TLS_STATIC_INFO_VERSION &&
-      !dlvsym(RTLD_NEXT, "glob", "GLIBC_2.27"))
+  if (CHECK_GET_TLS_STATIC_INFO_VERSION && GetGlibcVersion(nullptr) < 27)
     CallGetTls<GetTlsStaticInfoRegparmCall>(get_tls_static_info_ptr,
                                             &tls_size, &tls_align);
   else


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D48255.151615.patch
Type: text/x-patch
Size: 1076 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180616/3830f837/attachment.bin>


More information about the llvm-commits mailing list