libretiny: fix RTL8710B linker regex — output is .ram_image2.text not .image2.ram.text

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.
This commit is contained in:
J. Nick Koston
2026-04-15 15:28:46 -10:00
parent f0944a944a
commit eae6e6d32b
@@ -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):