diff --git a/src/arch/riscv/common_riscv.lds b/src/arch/riscv/common_riscv.lds index 8d09ccc6f5..dedbe9b2ae 100644 --- a/src/arch/riscv/common_riscv.lds +++ b/src/arch/riscv/common_riscv.lds @@ -44,10 +44,8 @@ SECTIONS .text . : AT(ADDR(.text) - KERNEL_OFFSET) { - . = ALIGN(4K); - - - /* Standard kernel */ + /* runtime kernel */ + *(.vectors) *(.text) } diff --git a/src/arch/riscv/traps.S b/src/arch/riscv/traps.S index c0eb05ecae..367c7a9fe5 100644 --- a/src/arch/riscv/traps.S +++ b/src/arch/riscv/traps.S @@ -14,16 +14,14 @@ #define REGBYTES (CONFIG_WORD_SIZE / 8) -.section .text - -.global trap_entry .extern c_handle_syscall .extern c_handle_fastpath_reply_recv .extern c_handle_fastpath_call .extern c_handle_interrupt .extern c_handle_exception -trap_entry: +.section .vectors, "ax" +BEGIN_FUNC(trap_entry) #ifdef ENABLE_SMP_SUPPORT /* The sscratch contains the stack for the current core */ @@ -145,3 +143,5 @@ interrupt: /* Save NextIP */ STORE x1, (34*REGBYTES)(t0) j c_handle_interrupt + +END_FUNC(trap_entry)