From eae6e6d32ba306ee65b13f41a0b0c8825e6b3dc2 Mon Sep 17 00:00:00 2001 From: "J. Nick Koston" Date: Wed, 15 Apr 2026 15:28:46 -1000 Subject: [PATCH] =?UTF-8?q?libretiny:=20fix=20RTL8710B=20linker=20regex=20?= =?UTF-8?q?=E2=80=94=20output=20is=20.ram=5Fimage2.text=20not=20.image2.ra?= =?UTF-8?q?m.text?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Confused the output section name with the input glob. RTL8710B's linker template has: .ram_image2.text : { KEEP(*(.image2.ram.text*)) } > BD_RAM so we need to match ".ram_image2.text :" and inject our extra KEEP(*(.sram.text*)) alongside the existing input glob. CI caught this; the test_build_components rtl87xx-ard smoke test now exercises the patcher. --- esphome/components/libretiny/patch_linker.py.script | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/esphome/components/libretiny/patch_linker.py.script b/esphome/components/libretiny/patch_linker.py.script index f7f536df4ec..63d95000b61 100644 --- a/esphome/components/libretiny/patch_linker.py.script +++ b/esphome/components/libretiny/patch_linker.py.script @@ -36,7 +36,11 @@ _KEEP_LINE = ( + _MARKER + "\n" ) _LN_COPY = re.compile(r"(\.flash_copysection\s*:\s*\{\s*\n)") -_RTL8710B_IMAGE2 = re.compile(r"(\.image2\.ram\.text\s*:\s*\{\s*\n)") +# RTL8710B's output section is ".ram_image2.text"; its stock linker consumes +# "*(.image2.ram.text*)" as an input glob inside that output, but we need to +# add a second input glob "*(.sram.text*)" so the ESPHome-marked functions +# land in the same RAM-resident output. +_RTL8710B_IMAGE2 = re.compile(r"(\.ram_image2\.text\s*:\s*\{\s*\n)") def _detect(env):