From 177f95464e9fbea6f7ebfc4ab8fed74a758374ed Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Tue, 19 Oct 2021 21:33:38 -0700 Subject: [PATCH] arm: Use correct macro for z_interrupt_stacks declaration in stack.h There are two macros for declaring stack arrays: K_KERNEL_STACK_ARRAY_DEFINE: Defines the array, allocating storage and setting the section name K_KERNEL_STACK_ARRAY_EXTERN Declares the name of a stack array allowing code to reference the array which must be defined elsewhere arch/arm/include/aarch32/cortex_m/stack.h was mis-using K_KERNEL_STACK_ARRAY_DEFINE to declare z_interrupt_stacks by sticking 'extern' in front of the macro use. However, when this macro also set the object file section for the symbol, having two of those caused a conflict in the compiler due to the automatic unique name mechanism used for sections to allow unused symbols to be discarded during linking. This patch makes the header use the correct macro. Signed-off-by: Keith Packard --- arch/arm/include/aarch32/cortex_m/stack.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/arm/include/aarch32/cortex_m/stack.h b/arch/arm/include/aarch32/cortex_m/stack.h index c6c6f57e5ef..c1ff2269565 100644 --- a/arch/arm/include/aarch32/cortex_m/stack.h +++ b/arch/arm/include/aarch32/cortex_m/stack.h @@ -26,7 +26,7 @@ extern "C" { #endif -extern K_KERNEL_STACK_ARRAY_DEFINE(z_interrupt_stacks, CONFIG_MP_NUM_CPUS, +K_KERNEL_STACK_ARRAY_EXTERN(z_interrupt_stacks, CONFIG_MP_NUM_CPUS, CONFIG_ISR_STACK_SIZE); /**