| /* |
| * 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; |
| } |