From 4e90efa79fe477ca9c3644bf71ca04b2cd651ec4 Mon Sep 17 00:00:00 2001 From: Andriy Gelman Date: Thu, 30 Jun 2022 22:51:10 -0400 Subject: [PATCH] linker: set __rom_region_end via an offset from __rom_region_start Currently __rom_region_end points to the virtual memory address, while __rom_region_start points to the load memory address. In most cases the two address spaces will be the same. In the case of the infineon xmc4xxx series they can be different because flash can be read via a different cachable address space. Evaluate __rom_region_end as an offset from __rom_region_start to fix this possible issue. Signed-off-by: Andriy Gelman --- include/zephyr/arch/arm/aarch32/cortex_m/scripts/linker.ld | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/zephyr/arch/arm/aarch32/cortex_m/scripts/linker.ld b/include/zephyr/arch/arm/aarch32/cortex_m/scripts/linker.ld index 0fec0a9b93f..796a2f80a09 100644 --- a/include/zephyr/arch/arm/aarch32/cortex_m/scripts/linker.ld +++ b/include/zephyr/arch/arm/aarch32/cortex_m/scripts/linker.ld @@ -209,7 +209,7 @@ SECTIONS __rodata_region_end = .; MPU_ALIGN(__rodata_region_end - ADDR(rom_start)); - __rom_region_end = .; + __rom_region_end = __rom_region_start + . - ADDR(rom_start); GROUP_END(ROMABLE_REGION)