From 93801c6447c7771208cf91378e4726341fddf450 Mon Sep 17 00:00:00 2001 From: Tim Nordell Date: Fri, 13 Jan 2017 09:54:15 -0600 Subject: [PATCH] arm: Adjust entry point of XIP kernels to the __reset function The entry point specified in the elf file should always point to executable code, and not to the interrupt vector table. Pointing to the vector table as the entry point in the elf file presents problems with running the kernel against a debugger as the debugger starts the program counter at the top of the interrupt vector table. Change-Id: I76051f6e99a44bab72936670bead5fb8191a6ec7 Signed-off-by: Tim Nordell --- arch/arm/core/cortex_m/reset.S | 4 +--- arch/arm/core/cortex_m/vector_table.S | 5 ----- 2 files changed, 1 insertion(+), 8 deletions(-) diff --git a/arch/arm/core/cortex_m/reset.S b/arch/arm/core/cortex_m/reset.S index 286122505e0..d586d2c799b 100644 --- a/arch/arm/core/cortex_m/reset.S +++ b/arch/arm/core/cortex_m/reset.S @@ -50,14 +50,12 @@ GDATA(_interrupt_stack) SECTION_SUBSEC_FUNC(TEXT,_reset_section,__reset) /* - * In non-XIP kernels, the entry point is located at the __reset symbol, which + * The entry point is located at the __reset symbol, which * is fetched by a XIP image playing the role of a bootloader, which jumps to * it, not through the reset vector mechanism. Such bootloaders might want to * search for a __start symbol instead, so create that alias here. */ -#if !defined(CONFIG_XIP) SECTION_SUBSEC_FUNC(TEXT,_reset_section,__start) -#endif /* lock interrupts: will get unlocked when switch to main task */ #if defined(CONFIG_ARMV6_M) diff --git a/arch/arm/core/cortex_m/vector_table.S b/arch/arm/core/cortex_m/vector_table.S index 437aca0411a..ca28b1c7d9c 100644 --- a/arch/arm/core/cortex_m/vector_table.S +++ b/arch/arm/core/cortex_m/vector_table.S @@ -28,11 +28,6 @@ GDATA(_main_stack) SECTION_SUBSEC_FUNC(exc_vector_table,_vector_table_section,_vector_table) -/* in XIP kernels. the entry point is also the start of the vector table */ -#if defined(CONFIG_XIP) -SECTION_SUBSEC_FUNC(exc_vector_table,_vector_table_section,__start) -#endif - /* * setting the _very_ early boot on the main stack allows to use memset * on the interrupt stack when CONFIG_INIT_STACKS is enabled before