zephyr/cmake/bintools/gnu
Grzegorz Swiderski f2dc4a0ecf cmake: Adjust LMA for user-specified sections
Fixes #64149

Add support for a new Kconfig symbol: BUILD_OUTPUT_ADJUST_LMA_SECTIONS.
This is supplemental to the existing BUILD_OUTPUT_ADJUST_LMA setting,
which normally adjusts all output sections' LMA by the provided offset.
Defining the new symbol will narrow down the set of applicable sections
to a user-specified CMake list of name patterns.

Example usage:

DT_CHOSEN_Z_FLASH = zephyr,flash
DT_CHOSEN_Z_SRAM = zephyr,sram
config BUILD_OUTPUT_ADJUST_LMA
        default "$(dt_chosen_reg_addr_hex,$(DT_CHOSEN_Z_FLASH)) - \
                 $(dt_chosen_reg_addr_hex,$(DT_CHOSEN_Z_SRAM))"

config BUILD_OUTPUT_ADJUST_LMA_SECTIONS
        default "*;!bss;!noinit"

Supported values for BUILD_OUTPUT_ADJUST_LMA_SECTIONS are aligned with
objcopy, since this feature has only been supported with GNU binutils
thus far.

Signed-off-by: Grzegorz Swiderski <grzegorz.swiderski@nordicsemi.no>
2024-08-12 15:53:42 +02:00
..
target.cmake buildsystem: Add an option to enable LTO 2024-02-02 19:49:36 +01:00
target_bintools.cmake cmake: Adjust LMA for user-specified sections 2024-08-12 15:53:42 +02:00