[PATCH] D44623: Fix asan on i?86-linux (32-bit) against glibc 2.27 and later

Jakub Jelínek via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue May 22 06:06:18 PDT 2018


jakubjelinek added inline comments.


================
Comment at: compiler-rt/lib/sanitizer_common/sanitizer_linux_libcdep.cc:185
+struct GetTlsStaticInfoRegparmCall {
+  typedef void (*get_tls_func)(size_t*, size_t*) DL_INTERNAL_FUNCTION;
+};
----------------
vitalybuka wrote:
> Maybe just inline it here:
> ```
> typedef void (*get_tls_func)(size_t*, size_t*) __attribute__((regparm(3), stdcall))
> ```
That isn't possible.  If you don't want ifdefs in the code, in particular the
	​  if (CHECK_GET_TLS_STATIC_INFO_VERSION &&
	​      !dlvsym(RTLD_NEXT, "glob", "GLIBC_2.27"))
	​    CallGetTls<GetTlsStaticInfoRegparmCall>(get_tls_static_info_ptr,
	​                                            &tls_size, &tls_align);
code to be ifdefed out if not i?86, then the GetTlsStaticInfoRegparmCall class must be defined even for other targets, even when after optimizations it will not be really used, and so you can't use i?86 specific attributes in there.


Repository:
  rL LLVM

https://reviews.llvm.org/D44623





More information about the llvm-commits mailing list