[compiler-rt] [tsan] Fix GetTls for aarch64
This patch fix the function GetTls for aarch64, where it assumes it follows the x86_64 way where the TLS initial address is at the end of TLS. Instead aarch64 set the TLS address as the thread pointer. llvm-svn: 246148
This commit is contained in:
parent
0e0c1901c9
commit
8ea893a57a
|
@ -327,12 +327,12 @@ uptr ThreadSelf() {
|
|||
#if !SANITIZER_GO
|
||||
static void GetTls(uptr *addr, uptr *size) {
|
||||
#if SANITIZER_LINUX && !SANITIZER_ANDROID
|
||||
# if defined(__x86_64__) || defined(__i386__) || defined(__aarch64__)
|
||||
# if defined(__x86_64__) || defined(__i386__)
|
||||
*addr = ThreadSelf();
|
||||
*size = GetTlsSize();
|
||||
*addr -= *size;
|
||||
*addr += ThreadDescriptorSize();
|
||||
# elif defined(__mips__)
|
||||
# elif defined(__mips__) || defined(__aarch64__)
|
||||
*addr = ThreadSelf();
|
||||
*size = GetTlsSize();
|
||||
# else
|
||||
|
|
Loading…
Reference in New Issue