mirror of
https://github.com/esphome/esphome.git
synced 2026-09-02 02:56:01 +00:00
libretiny: use strong linker assignments for SRAM text markers
PROVIDE symbols without references get garbage-collected by the linker, so the post-link summary was falling back to the symbol-scrape path on every family. Use direct assignment so the markers always land in the ELF symbol table, giving an exact byte count for the ESPHome IRAM_ATTR contribution.
This commit is contained in:
@@ -20,10 +20,12 @@ import re
|
||||
|
||||
|
||||
_MARKER = "/* esphome .sram.text */"
|
||||
# Strong assignments (not PROVIDE) so the symbols are always emitted in the
|
||||
# ELF; PROVIDE symbols with no references can be garbage-collected.
|
||||
_KEEP_LINE = (
|
||||
" PROVIDE(__esphome_sram_text_start = .); "
|
||||
" __esphome_sram_text_start = .; "
|
||||
"KEEP(*(.sram.text*)) "
|
||||
"PROVIDE(__esphome_sram_text_end = .); "
|
||||
"__esphome_sram_text_end = .; "
|
||||
+ _MARKER + "\n"
|
||||
)
|
||||
_BK_DATA = re.compile(r"(\.data\s*:\s*\{\s*\n)")
|
||||
|
||||
Reference in New Issue
Block a user