diff --git a/l0dables/lib/crt.s b/l0dables/lib/crt.s index b811c4e6cb0c732b0de7091e596da94fce9bd1ca..57726cb566590e7b6ed90f9b5f71ae095ca55fa7 100644 --- a/l0dables/lib/crt.s +++ b/l0dables/lib/crt.s @@ -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 __isr_vector: .long 0 /* Top of Stack, overriden by l0der at load time */ diff --git a/l0dables/lib/l0dable.ld b/l0dables/lib/l0dable.ld index 31fbb773de00115fecb9a49d7a449a38cbfc02b6..aa7225cfecc230c6e45017d009771e8e7fdaaf0d 100644 --- a/l0dables/lib/l0dable.ld +++ b/l0dables/lib/l0dable.ld @@ -33,6 +33,9 @@ SECTIONS { .text : { + /* The vector table needs 128 byte alignment */ + . = ALIGN(128); + KEEP(*(.text.isr_vector)) *(.text*) *(.rodata*) diff --git a/l0dables/lib/meson.build b/l0dables/lib/meson.build index f2f16295ae51a3d5ba0680ae14c220911dd540d1..d2407514569cdb380817abed63ac20a19384f78f 100644 --- a/l0dables/lib/meson.build +++ b/l0dables/lib/meson.build @@ -3,7 +3,7 @@ l0dable_startup_lib = static_library( 'crt.s', 'hardware.c', dependencies: [api_caller], - pic: true, + c_args: ['-fpie'], ) l0dable_startup = declare_dependency(