ESPHome 2026.12.0-dev
Loading...
Searching...
No Matches
stack_thunk_stubs.cpp
Go to the documentation of this file.
1/*
2 * Linker wrap stub for the Arduino core's BearSSL stack-overflow handler.
3 *
4 * stack_thunk_fatal_smashing() prints "FATAL ERROR: BSSL stack smashing detected" and then calls
5 * __stack_chk_fail(). Any build that links BearSSL (http_request HTTPS, the nextion upload, MQTT TLS)
6 * links StackThunk, and on ESP8266 .rodata lives in DRAM, so the message costs 44 bytes of RAM. The
7 * postmortem that __stack_chk_fail() prints already reports the stack smash. Builds without BearSSL
8 * never reference the handler, so the wrap costs them nothing.
9 */
10
11#if defined(USE_ESP8266)
12
13namespace esphome::esp8266 {}
14
15// NOLINTBEGIN(bugprone-reserved-identifier,cert-dcl37-c,cert-dcl51-cpp,readability-identifier-naming)
16extern "C" {
17
20
21} // extern "C"
22// NOLINTEND(bugprone-reserved-identifier,cert-dcl37-c,cert-dcl51-cpp,readability-identifier-naming)
23
24#endif // USE_ESP8266
void __wrap_stack_thunk_fatal_smashing()
void __stack_chk_fail()