2023-02-01 14:52:54 -06:00
|
|
|
#include <hal_trace.h>
|
2022-08-15 04:20:27 -05:00
|
|
|
#include <stdint.h>
|
|
|
|
#include <string.h>
|
|
|
|
|
|
|
|
uint32_t __stack_chk_guard = 0xdeadbeef;
|
|
|
|
|
2023-02-01 14:52:54 -06:00
|
|
|
void __attribute__((__constructor__)) __stack_chk_init(void) {
|
2022-08-15 04:20:27 -05:00
|
|
|
if (__stack_chk_guard != 0)
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2023-02-01 14:52:54 -06:00
|
|
|
void __attribute__((__noreturn__)) __stack_chk_fail(void) {
|
2022-08-15 04:20:27 -05:00
|
|
|
const char *msg = "*** stack smashing detected ***: terminated\n";
|
|
|
|
ASSERT(0, "%s", msg);
|
|
|
|
}
|