Skip to content

Commit

Permalink
disable array bounds checking for __tls_start
Browse files Browse the repository at this point in the history
  • Loading branch information
WinterMute committed May 2, 2022
1 parent 1168687 commit b76a245
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions libctru/source/system/syscalls.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit b76a245

Please sign in to comment.