| author | |
| committer | |
| log | d14f7f7a09ef82ff42026165624c3968eed7e255 |
| tree | 6714250e6cc7a804cb691ac8b5ed038cd41ea809 |
| parent | 833d4c9ce4fb2588607a7c94d7919ad4e2edb641 |
| signature |
https://github.com/llvm/llvm-project/pull/1200364 files changed, 14 insertions(+), 8 deletions(-)
lib/libtsan/sanitizer_common/sanitizer_linux.cpp+4| ... | ... | @@ -86,6 +86,10 @@ |
| 86 | 86 | # include <sys/sysmacros.h> |
| 87 | 87 | # endif |
| 88 | 88 | |
| 89 | # if SANITIZER_LINUX && defined(__powerpc64__) | |
| 90 | # include <asm/ptrace.h> | |
| 91 | # endif | |
| 92 | ||
| 89 | 93 | # if SANITIZER_FREEBSD |
| 90 | 94 | # include <machine/atomic.h> |
| 91 | 95 | # include <sys/exec.h> |
lib/libtsan/sanitizer_common/sanitizer_linux_libcdep.cpp+7-6| ... | ... | @@ -619,21 +619,22 @@ static void GetTls(uptr *addr, uptr *size) { |
| 619 | 619 | *addr = tp - RoundUpTo(*size, align); |
| 620 | 620 | *size = tp - *addr + ThreadDescriptorSize(); |
| 621 | 621 | # else |
| 622 | if (SANITIZER_GLIBC) | |
| 623 | *size += 1664; | |
| 624 | else if (SANITIZER_FREEBSD) | |
| 625 | *size += 128; // RTLD_STATIC_TLS_EXTRA | |
| 626 | # if defined(__mips__) || defined(__powerpc64__) || SANITIZER_RISCV64 | |
| 622 | # if SANITIZER_GLIBC | |
| 623 | *size += 1664; | |
| 624 | # elif SANITIZER_FREEBSD | |
| 625 | *size += 128; // RTLD_STATIC_TLS_EXTRA | |
| 626 | # if defined(__mips__) || defined(__powerpc64__) || SANITIZER_RISCV64 | |
| 627 | 627 | const uptr pre_tcb_size = TlsPreTcbSize(); |
| 628 | 628 | *addr -= pre_tcb_size; |
| 629 | 629 | *size += pre_tcb_size; |
| 630 | # else | |
| 630 | # else | |
| 631 | 631 | // arm and aarch64 reserve two words at TP, so this underestimates the range. |
| 632 | 632 | // However, this is sufficient for the purpose of finding the pointers to |
| 633 | 633 | // thread-specific data keys. |
| 634 | 634 | const uptr tcb_size = ThreadDescriptorSize(); |
| 635 | 635 | *addr -= tcb_size; |
| 636 | 636 | *size += tcb_size; |
| 637 | # endif | |
| 637 | 638 | # endif |
| 638 | 639 | # endif |
| 639 | 640 | # elif SANITIZER_NETBSD |
lib/libtsan/sanitizer_common/sanitizer_platform_limits_posix.cpp+1-1| ... | ... | @@ -96,7 +96,7 @@ |
| 96 | 96 | # include <sys/ptrace.h> |
| 97 | 97 | # if defined(__mips64) || defined(__aarch64__) || defined(__arm__) || \ |
| 98 | 98 | defined(__hexagon__) || defined(__loongarch__) || SANITIZER_RISCV64 || \ |
| 99 | defined(__sparc__) | |
| 99 | defined(__sparc__) || defined(__powerpc64__) | |
| 100 | 100 | # include <asm/ptrace.h> |
| 101 | 101 | # ifdef __arm__ |
| 102 | 102 | typedef struct user_fpregs elf_fpregset_t; |
lib/libtsan/sanitizer_common/sanitizer_stoptheworld_linux_libcdep.cpp+2-1| ... | ... | @@ -31,7 +31,8 @@ |
| 31 | 31 | #include <sys/types.h> // for pid_t |
| 32 | 32 | #include <sys/uio.h> // for iovec |
| 33 | 33 | #include <elf.h> // for NT_PRSTATUS |
| 34 | #if (defined(__aarch64__) || SANITIZER_RISCV64 || SANITIZER_LOONGARCH64) && \ | |
| 34 | #if (defined(__aarch64__) || defined(__powerpc64__) || \ | |
| 35 | SANITIZER_RISCV64 || SANITIZER_LOONGARCH64) && \ | |
| 35 | 36 | !SANITIZER_ANDROID |
| 36 | 37 | // GLIBC 2.20+ sys/user does not include asm/ptrace.h |
| 37 | 38 | # include <asm/ptrace.h> |