[sanitizer] Don't call __tls_get_addr on s390x after D98926
authorFangrui Song <i@maskray.me>
Sun, 18 Apr 2021 17:42:43 +0000 (10:42 -0700)
committerFangrui Song <i@maskray.me>
Sun, 18 Apr 2021 17:42:44 +0000 (10:42 -0700)
glibc s390x doesn't define __tls_get_addr.

Fix PR50017

compiler-rt/lib/sanitizer_common/sanitizer_linux_libcdep.cpp

index d5f61e1..f1a0f89 100644 (file)
@@ -322,11 +322,13 @@ static int CollectStaticTlsBlocks(struct dl_phdr_info *info, size_t size,
   if (!info->dlpi_tls_modid)
     return 0;
   uptr begin = (uptr)info->dlpi_tls_data;
+#ifndef __s390__
   if (!g_use_dlpi_tls_data) {
     // Call __tls_get_addr as a fallback. This forces TLS allocation on glibc
     // and FreeBSD.
     size_t mod_and_off[2] = {info->dlpi_tls_modid, 0};
     begin = (uptr)__tls_get_addr(mod_and_off);
+#endif
   }
   for (unsigned i = 0; i != info->dlpi_phnum; ++i)
     if (info->dlpi_phdr[i].p_type == PT_TLS) {