From 35059b3e405f2305a445fd0071556e42685f808f Mon Sep 17 00:00:00 2001 From: Mahavir Jain Date: Mon, 15 Jun 2026 11:36:30 +0530 Subject: [PATCH] fix(bootloader): place esp_crypto_clk in loader IRAM section Commit 69d548c8 ("feat(esp_security): suppoer s31 security clock management") introduced a new esp_crypto_clk source file in esp_security but did not add it to the bootloader loader IRAM input sections. As a result the crypto clock code was not placed in the loader IRAM region, causing a regression on targets that use it during bootloader load. Add *libesp_security.a:esp_crypto_clk.* to the bootloader sections linker fragments for all targets that carry the esp_security.a dependency (esp32c5, esp32p4, esp32s31), placed alongside esp_crypto_periph_clk. --- .../subproject/main/ld/esp32c5/bootloader.sections.ld.in | 1 + .../subproject/main/ld/esp32p4/bootloader.sections.ld.in | 2 ++ .../subproject/main/ld/esp32s31/bootloader.sections.ld.in | 1 + 3 files changed, 4 insertions(+) diff --git a/components/bootloader/subproject/main/ld/esp32c5/bootloader.sections.ld.in b/components/bootloader/subproject/main/ld/esp32c5/bootloader.sections.ld.in index 4b2e639c228..330bf7c56ae 100644 --- a/components/bootloader/subproject/main/ld/esp32c5/bootloader.sections.ld.in +++ b/components/bootloader/subproject/main/ld/esp32c5/bootloader.sections.ld.in @@ -37,6 +37,7 @@ *libesp_hal_security.a:huk_hal.*(.literal .text .literal.* .text.*) \ *libesp_hal_security.a:key_mgr_hal.*(.literal .text .literal.* .text.*) \ *libesp_security.a:esp_key_mgr.*(.literal .text .literal.* .text.*) \ + *libesp_security.a:esp_crypto_clk.*(.literal .text .literal.* .text.*) \ *libesp_security.a:esp_crypto_periph_clk.*(.literal .text .literal.* .text.*) \ *libesp_security.a:esp_crypto_lock.*(.literal .text .literal.* .text.*) \ *libesp_hw_support.a:rtc_clk.*(.literal .text .literal.* .text.*) \ diff --git a/components/bootloader/subproject/main/ld/esp32p4/bootloader.sections.ld.in b/components/bootloader/subproject/main/ld/esp32p4/bootloader.sections.ld.in index f54803a1894..d4b3b2fff15 100644 --- a/components/bootloader/subproject/main/ld/esp32p4/bootloader.sections.ld.in +++ b/components/bootloader/subproject/main/ld/esp32p4/bootloader.sections.ld.in @@ -36,6 +36,7 @@ *libesp_hal_security.a:huk_hal.*(.literal .text .literal.* .text.*) \ *libesp_hal_security.a:key_mgr_hal.*(.literal .text .literal.* .text.*) \ *libesp_security.a:esp_key_mgr.*(.literal .text .literal.* .text.*) \ + *libesp_security.a:esp_crypto_clk.*(.literal .text .literal.* .text.*) \ *libesp_security.a:esp_crypto_periph_clk.*(.literal .text .literal.* .text.*) \ *libesp_security.a:esp_crypto_lock.*(.literal .text .literal.* .text.*) \ *libesp_hw_support.a:rtc_clk.*(.literal .text .literal.* .text.*) \ @@ -74,6 +75,7 @@ *libhal.a:efuse_hal.*(.literal .text .literal.* .text.*) \ *libesp_hal_security.a:huk_hal.*(.literal .text .literal.* .text.*) \ *libesp_hal_security.a:key_mgr_hal.*(.literal .text .literal.* .text.*) \ + *libesp_security.a:esp_crypto_clk.*(.literal .text .literal.* .text.*) \ *libesp_security.a:esp_crypto_periph_clk.*(.literal .text .literal.* .text.*) \ *libesp_hal_wdt.a:wdt_hal_iram.*(.literal .text .literal.* .text.*) \ *libesp_hw_support.a:rtc_clk.*(.literal .text .literal.* .text.*) \ diff --git a/components/bootloader/subproject/main/ld/esp32s31/bootloader.sections.ld.in b/components/bootloader/subproject/main/ld/esp32s31/bootloader.sections.ld.in index 4b2e639c228..330bf7c56ae 100644 --- a/components/bootloader/subproject/main/ld/esp32s31/bootloader.sections.ld.in +++ b/components/bootloader/subproject/main/ld/esp32s31/bootloader.sections.ld.in @@ -37,6 +37,7 @@ *libesp_hal_security.a:huk_hal.*(.literal .text .literal.* .text.*) \ *libesp_hal_security.a:key_mgr_hal.*(.literal .text .literal.* .text.*) \ *libesp_security.a:esp_key_mgr.*(.literal .text .literal.* .text.*) \ + *libesp_security.a:esp_crypto_clk.*(.literal .text .literal.* .text.*) \ *libesp_security.a:esp_crypto_periph_clk.*(.literal .text .literal.* .text.*) \ *libesp_security.a:esp_crypto_lock.*(.literal .text .literal.* .text.*) \ *libesp_hw_support.a:rtc_clk.*(.literal .text .literal.* .text.*) \