Verified Commit 6e2d3491 authored by Rahix's avatar Rahix
Browse files

fix(l0dables): Fix vector table alignment

The vector table's alignment requirements depend on the number of
interrupts [1].  In our case, we have 0x6E(=110) interrupts and thus an
alignment requirement of 0x80(=128).

To satisfy this requirement, this commit moves the IVT to the beginning
of .text and enforces a 128 byte alignment.  Please note that the
headers which come before .text will push the IVT to 0x100 instead of
having it directly in the beginning at 0x00.


Signed-off-by: Rahix's avatarRahix <>
parent 4c783757
......@@ -18,10 +18,10 @@
* All of the following (apart from Reset_Handler, which calls main())
* are backed by weak referenced symbols, which you can override just
* by defining them in C code.
* by defining them in C code.
.section .data
.align 2
.section .text.isr_vector
.align 7
.globl __isr_vector
.long 0 /* Top of Stack, overriden by l0der at load time */
......@@ -33,6 +33,9 @@ SECTIONS {
.text :
/* The vector table needs 128 byte alignment */
. = ALIGN(128);
......@@ -3,7 +3,7 @@ l0dable_startup_lib = static_library(
dependencies: [api_caller],
pic: true,
c_args: ['-fpie'],
l0dable_startup = declare_dependency(
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment