diff --git a/bin/chainboot/src/link.ld b/bin/chainboot/src/link.ld index d940a7c..839af8d 100644 --- a/bin/chainboot/src/link.ld +++ b/bin/chainboot/src/link.ld @@ -97,3 +97,5 @@ SECTIONS /DISCARD/ : { *(.comment) *(.gnu*) *(.note*) *(.eh_frame*) *(.text.boot*)} } + +INCLUDE linker/aarch64-exceptions.ld diff --git a/linker/aarch64-exceptions.ld b/linker/aarch64-exceptions.ld new file mode 100644 index 0000000..1f125d0 --- /dev/null +++ b/linker/aarch64-exceptions.ld @@ -0,0 +1,19 @@ +PROVIDE(current_el0_synchronous = default_exception_handler); +PROVIDE(current_el0_irq = default_exception_handler); +PROVIDE(current_el0_fiq = default_exception_handler); +PROVIDE(current_el0_serror = default_exception_handler); + +PROVIDE(current_elx_synchronous = default_exception_handler); +PROVIDE(current_elx_irq = default_exception_handler); +PROVIDE(current_elx_fiq = default_exception_handler); +PROVIDE(current_elx_serror = default_exception_handler); + +PROVIDE(lower_aarch64_synchronous = default_exception_handler); +PROVIDE(lower_aarch64_irq = default_exception_handler); +PROVIDE(lower_aarch64_fiq = default_exception_handler); +PROVIDE(lower_aarch64_serror = default_exception_handler); + +PROVIDE(lower_aarch32_synchronous = default_exception_handler); +PROVIDE(lower_aarch32_irq = default_exception_handler); +PROVIDE(lower_aarch32_fiq = default_exception_handler); +PROVIDE(lower_aarch32_serror = default_exception_handler); diff --git a/linker/aarch64.ld b/linker/aarch64.ld index 5d3e083..5541c9a 100644 --- a/linker/aarch64.ld +++ b/linker/aarch64.ld @@ -65,22 +65,4 @@ SECTIONS /DISCARD/ : { *(.comment) *(.gnu*) *(.note*) *(.eh_frame*) *(.text.chainboot*) } } -PROVIDE(current_el0_synchronous = default_exception_handler); -PROVIDE(current_el0_irq = default_exception_handler); -PROVIDE(current_el0_fiq = default_exception_handler); -PROVIDE(current_el0_serror = default_exception_handler); - -PROVIDE(current_elx_synchronous = default_exception_handler); -PROVIDE(current_elx_irq = default_exception_handler); -PROVIDE(current_elx_fiq = default_exception_handler); -PROVIDE(current_elx_serror = default_exception_handler); - -PROVIDE(lower_aarch64_synchronous = default_exception_handler); -PROVIDE(lower_aarch64_irq = default_exception_handler); -PROVIDE(lower_aarch64_fiq = default_exception_handler); -PROVIDE(lower_aarch64_serror = default_exception_handler); - -PROVIDE(lower_aarch32_synchronous = default_exception_handler); -PROVIDE(lower_aarch32_irq = default_exception_handler); -PROVIDE(lower_aarch32_fiq = default_exception_handler); -PROVIDE(lower_aarch32_serror = default_exception_handler); +INCLUDE linker/aarch64-exceptions.ld diff --git a/nucleus/build.rs b/nucleus/build.rs index da0d01f..75c61c1 100644 --- a/nucleus/build.rs +++ b/nucleus/build.rs @@ -1,6 +1,8 @@ const LINKER_SCRIPT: &str = "linker/aarch64.ld"; +const LINKER_SCRIPT_AUX: &str = "linker/aarch64-exceptions.ld"; fn main() { println!("cargo:rerun-if-changed={}", LINKER_SCRIPT); + println!("cargo:rerun-if-changed={}", LINKER_SCRIPT_AUX); println!("cargo:rustc-link-arg=--script={}", LINKER_SCRIPT); }