public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc r13-145] libsanitizer: cherry-pick commit b226894d475b from upstream
@ 2022-05-05 21:02 H.J. Lu
  0 siblings, 0 replies; only message in thread
From: H.J. Lu @ 2022-05-05 21:02 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:a48be2e513d9ddb2fa8800a158f18502a0923aec

commit r13-145-ga48be2e513d9ddb2fa8800a158f18502a0923aec
Author: H.J. Lu <hjl.tools@gmail.com>
Date:   Thu May 5 13:59:16 2022 -0700

    libsanitizer: cherry-pick commit b226894d475b from upstream
    
    cherry-pick:
    
    b226894d475b [sanitizer] [sanitizer] Correct GetTls for x32

Diff:
---
 libsanitizer/sanitizer_common/sanitizer_linux_libcdep.cpp | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/libsanitizer/sanitizer_common/sanitizer_linux_libcdep.cpp b/libsanitizer/sanitizer_common/sanitizer_linux_libcdep.cpp
index d966d857a76..620267cdd02 100644
--- a/libsanitizer/sanitizer_common/sanitizer_linux_libcdep.cpp
+++ b/libsanitizer/sanitizer_common/sanitizer_linux_libcdep.cpp
@@ -462,7 +462,11 @@ static void GetTls(uptr *addr, uptr *size) {
 #elif SANITIZER_GLIBC && defined(__x86_64__)
   // For aarch64 and x86-64, use an O(1) approach which requires relatively
   // precise ThreadDescriptorSize. g_tls_size was initialized in InitTlsSize.
+#  if SANITIZER_X32
+  asm("mov %%fs:8,%0" : "=r"(*addr));
+#  else
   asm("mov %%fs:16,%0" : "=r"(*addr));
+#  endif
   *size = g_tls_size;
   *addr -= *size;
   *addr += ThreadDescriptorSize();


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2022-05-05 21:02 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-05-05 21:02 [gcc r13-145] libsanitizer: cherry-pick commit b226894d475b from upstream H.J. Lu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).