Skip to content

Commit

Permalink
[sanitizer] Temporarily switch ppc64 to the _dl_get_tls_static_info i…
Browse files Browse the repository at this point in the history
…mplementation

sanitizer-ppc64le-linux is good while clang-ppc64le-linux has test
failures due to GetStaticTlsRange(addr, size) set *addr is 0.
  • Loading branch information
MaskRay committed Mar 27, 2021
1 parent 38edd23 commit 31e541e
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion compiler-rt/lib/sanitizer_common/sanitizer_linux_libcdep.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -420,7 +420,15 @@ static void GetTls(uptr *addr, uptr *size) {
#else
if (SANITIZER_GLIBC)
*size += 1664;
#if defined(__mips__) || defined(__powerpc64__) || SANITIZER_RISCV64
#if defined(__powerpc64__)
// TODO Figure out why *addr may be zero and use TlsPreTcbSize.
void *ptr = dlsym(RTLD_NEXT, "_dl_get_tls_static_info");
uptr tls_size, tls_align;
((void (*)(size_t *, size_t *))ptr)(&tls_size, &tls_align);
asm("addi %0,13,-0x7000" : "=r"(*addr));
*addr -= TlsPreTcbSize();
*size = RoundUpTo(tls_size + TlsPreTcbSize(), 16);
#elif defined(__mips__) || SANITIZER_RISCV64
const uptr pre_tcb_size = TlsPreTcbSize();
*addr -= pre_tcb_size;
*size += pre_tcb_size;
Expand Down

0 comments on commit 31e541e

Please sign in to comment.