Skip to content

Commit 766081b

Browse files
committed
[nrf fromtree] boot/zephyr/main: fix placement of pointer to arm vector
pointer to the image ARM vector table should be placed out of stack which is being reconfigured before vt is used for branch to the application. This caused transient boot failure when CONFIG_LTO=y. Moved vt to static data scope. Signed-off-by: Andrzej Puzdrowski <[email protected]> (cherry picked from commit 264f6ee)
1 parent e110d76 commit 766081b

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

boot/zephyr/main.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,10 @@ struct arm_vector_table {
164164

165165
static void do_boot(struct boot_rsp *rsp)
166166
{
167-
struct arm_vector_table *vt;
167+
/* vt is static as it shall not land on the stack,
168+
* as this procedure modifies stack pointer before usage of *vt
169+
*/
170+
static struct arm_vector_table *vt;
168171

169172
/* The beginning of the image is the ARM vector table, containing
170173
* the initial stack pointer address and the reset vector

0 commit comments

Comments
 (0)