From 98108d9d71e8cf4e6472aaa28a93fcbb2ccf80e1 Mon Sep 17 00:00:00 2001 From: Sylvio Alves Date: Tue, 1 Jun 2021 12:09:02 -0300 Subject: [PATCH] linker: tweak link iterable with padding This adds a new Z_LINK_ITERABLE_ALIGNED option that includes alignment. Main reason is to avoid repeting ALIGN() calls for every iterable needed on ESP32 linker script. Signed-off-by: Sylvio Alves --- include/linker/linker-defs.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/include/linker/linker-defs.h b/include/linker/linker-defs.h index e0b23f62b31..3ae8f27c5df 100644 --- a/include/linker/linker-defs.h +++ b/include/linker/linker-defs.h @@ -42,6 +42,10 @@ KEEP(*(SORT_BY_NAME(._##struct_type.static.*))); \ _CONCAT(_##struct_type, _list_end) = . +#define Z_LINK_ITERABLE_ALIGNED(struct_type, align) \ + . = ALIGN(align); \ + Z_LINK_ITERABLE(struct_type); + #define Z_LINK_ITERABLE_GC_ALLOWED(struct_type) \ _CONCAT(_##struct_type, _list_start) = .; \ *(SORT_BY_NAME(._##struct_type.static.*)); \