Skip to content

Commit 9943ef6

Browse files
author
Emil Fresk
committed
cortex-m-rt: Add alignment check for the .vector_table
1 parent f2fc7d3 commit 9943ef6

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

cortex-m-rt/link.x.in

+5
Original file line numberDiff line numberDiff line change
@@ -261,6 +261,11 @@ Possible solutions, from most likely to less likely:
261261
may be enabling it)
262262
- Supply the interrupt handlers yourself. Check the documentation for details.");
263263

264+
ASSERT((ADDR(.vector_table) % MAX(128, (1 << (LOG2CEIL(SIZEOF(.vector_table)))))) == 0, "
265+
ERROR(cortex-m-rt): The interrupt vectors are misaligned. It needs to be aligned to the largest of:
266+
- 128 byte
267+
- Next power of two from the size of the vector table");
268+
264269
/* ## .text */
265270
ASSERT(ADDR(.vector_table) + SIZEOF(.vector_table) <= _stext, "
266271
ERROR(cortex-m-rt): The .text section can't be placed inside the .vector_table section

0 commit comments

Comments
 (0)