From a2b866e6fda11d7fc407cb26e8d6593e7406362e Mon Sep 17 00:00:00 2001 From: Pieter De Gendt Date: Mon, 6 May 2024 16:29:43 +0200 Subject: [PATCH] linker: Move iterable subalign value from header to kconfig Add a Kconfig option for iterable section subalignment. Signed-off-by: Pieter De Gendt --- Kconfig.zephyr | 7 +++++++ include/zephyr/linker/iterable_sections.h | 6 +----- 2 files changed, 8 insertions(+), 5 deletions(-) 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.