From b76a245b79b5c8b811e6a4069eee19bde12ac6ab Mon Sep 17 00:00:00 2001 From: Dave Murphy Date: Mon, 2 May 2022 15:10:17 +0100 Subject: [PATCH] disable array bounds checking for __tls_start --- libctru/source/system/syscalls.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/libctru/source/system/syscalls.c b/libctru/source/system/syscalls.c index c65a154..4d415aa 100644 --- a/libctru/source/system/syscalls.c +++ b/libctru/source/system/syscalls.c @@ -105,7 +105,10 @@ void initThreadVars(struct Thread_tag *thread) tv->magic = THREADVARS_MAGIC; tv->reent = thread != NULL ? &thread->reent : _impure_ptr; tv->thread_ptr = thread; +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Warray-bounds" tv->tls_tp = (thread != NULL ? (u8*)thread->stacktop : __tls_start) - 8; // Arm ELF TLS ABI mandates an 8-byte header +#pragma GCC diagnostic pop tv->srv_blocking_policy = false; // Kernel does not initialize fpscr at all, so we must do it ourselves