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:
J. Nick Koston
2026-04-15 14:07:31 -10:00
parent ab382c1e52
commit 8dba87014a
@@ -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)")