zephyr: kconfig: set TEXT_SECTION_OFFSET to zero
Ensure that the offset in .text is zero.
This is necessary to ensure that MCUBoot is linked at
the beginning of the boot partition, as intended.
Signed-off-by: Emanuele Di Santo <emdi@nordicsemi.no>
diff --git a/boot/zephyr/Kconfig b/boot/zephyr/Kconfig
index 77a695e..e87db5a 100644
--- a/boot/zephyr/Kconfig
+++ b/boot/zephyr/Kconfig
@@ -13,6 +13,18 @@
bool
select MPU_ALLOW_FLASH_WRITE if ARM_MPU
+if BOARD_HAS_NRF5_BOOTLOADER
+
+# When compiling MCUBoot, the image will be linked to the boot partition.
+# Override .text offset to make sure it is set to zero.
+# This is necessary when other bootloaders set a different default for
+# application images which are not bootloaders.
+
+config TEXT_SECTION_OFFSET
+ default 0x00
+
+endif # BOARD_HAS_NRF5_BOOTLOADER
+
config BOOT_USE_MBEDTLS
bool
# Hidden option