blob: 24abbcb34f5b54361c1b44e15c6935f5484d7acd [file] [log] [blame]
/*
* Copyright © 2021, Keith Packard <keithp@keithp.com>
*
* SPDX-License-Identifier: Apache-2.0
*/
#include "picolibc-hooks.h"
/* This function gets called if static buffer overflow detection is enabled on
* stdlib side (Picolibc here), in case such an overflow is detected. Picolibc
* provides an implementation not suitable for us, so we override it here.
*/
__weak FUNC_NORETURN void __chk_fail(void)
{
printk("* buffer overflow detected *\n");
z_except_reason(K_ERR_STACK_CHK_FAIL);
CODE_UNREACHABLE;
}