feat(bootloader): split linker scripts into memory and sections

Replaced per-target bootloader.ld.in with bootloader.memory.ld.in and
bootloader.sections.ld.in.

Common code moved to file bootloader.sections.common.ld

Unify ESP32-P4 ECO4- and ECO4+ linker scripts into one shared script
Revision-specific code is selected with CONFIG_ESP32P4_SELECTS_REV_LESS_V3
This commit is contained in:
Alexey Lapshin
2026-04-03 11:40:33 +07:00
parent 49c770cf85
commit a1cbc20a91
43 changed files with 1744 additions and 4372 deletions
@@ -74,11 +74,8 @@ idf_build_set_property(__OUTPUT_SDKCONFIG 0)
# Define a property for the default linker script
set(LD_DEFAULT_PATH "${CMAKE_CURRENT_SOURCE_DIR}/main/ld/${IDF_TARGET}")
project(bootloader)
if(CONFIG_ESP32P4_SELECTS_REV_LESS_V3)
target_linker_script("__idf_main" INTERFACE "${LD_DEFAULT_PATH}/bootloader.rev0_2.ld.in")
else()
target_linker_script("__idf_main" INTERFACE "${LD_DEFAULT_PATH}/bootloader.ld.in")
endif()
target_linker_script("__idf_main" INTERFACE "${LD_DEFAULT_PATH}/bootloader.memory.ld.in")
target_linker_script("__idf_main" INTERFACE "${LD_DEFAULT_PATH}/bootloader.sections.ld.in")
idf_build_set_property(COMPILE_DEFINITIONS "BOOTLOADER_BUILD=1" APPEND)
idf_build_set_property(COMPILE_DEFINITIONS "NON_OS_BUILD=1" APPEND)