From bf50bfdbbe2ce6dd586036c9ff4f3b98152656fa Mon Sep 17 00:00:00 2001 From: Dave Murphy Date: Mon, 2 May 2022 23:11:24 +0100 Subject: [PATCH] disable array bounds checking for __tls_start --- nx/source/runtime/newlib.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/nx/source/runtime/newlib.c b/nx/source/runtime/newlib.c index 57112aa6..b3a2de08 100644 --- a/nx/source/runtime/newlib.c +++ b/nx/source/runtime/newlib.c @@ -433,7 +433,10 @@ void newlibSetup(void) tv->magic = THREADVARS_MAGIC; tv->thread_ptr = NULL; tv->reent = _impure_ptr; +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Warray-bounds" tv->tls_tp = __tls_start-2*sizeof(void*); // subtract size of Thread Control Block (TCB) +#pragma GCC diagnostic pop tv->handle = envGetMainThreadHandle(); u32 tls_size = __tdata_lma_end - __tdata_lma;