diff --git a/Kconfig.zephyr b/Kconfig.zephyr index edb9a795930..fd9076a38d9 100644 --- a/Kconfig.zephyr +++ b/Kconfig.zephyr @@ -316,6 +316,13 @@ config LINKER_USE_RELAX endmenu # "Linker Sections" +config LINKER_ITERABLE_SUBALIGN + int + default 8 if 64BIT + default 4 + help + Hidden option for the default subalignment of iterable sections. + config LINKER_DEVNULL_SUPPORT bool default y if CPU_CORTEX_M || (RISCV && !64BIT) diff --git a/include/zephyr/linker/iterable_sections.h b/include/zephyr/linker/iterable_sections.h index 397ff155e03..3eb4e9527b8 100644 --- a/include/zephyr/linker/iterable_sections.h +++ b/include/zephyr/linker/iterable_sections.h @@ -32,11 +32,7 @@ *(SORT_BY_NAME(._##struct_type.static.*)); \ _CONCAT(_##struct_type, _list_end) = . -#ifdef CONFIG_64BIT -#define Z_LINK_ITERABLE_SUBALIGN 8 -#else -#define Z_LINK_ITERABLE_SUBALIGN 4 -#endif +#define Z_LINK_ITERABLE_SUBALIGN CONFIG_LINKER_ITERABLE_SUBALIGN /** * @brief Define a read-only iterable section output.