Skip to content

Commit 4e6c2b6

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

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

cortex-m-rt/link.x.in

+6
Original file line numberDiff line numberDiff line change
@@ -261,6 +261,12 @@ 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): Interrupt vector table misalignment detected. The vector table must
266+
be aligned to the larger of:
267+
- 128 bytes
268+
- The next power of two greater than or equal to its size");
269+
264270
/* ## .text */
265271
ASSERT(ADDR(.vector_table) + SIZEOF(.vector_table) <= _stext, "
266272
ERROR(cortex-m-rt): The .text section can't be placed inside the .vector_table section

0 commit comments

Comments
 (0)