refactor(linker): 📦 Share exception handlers

This commit is contained in:
Berkus Decker 2022-11-01 20:33:59 +02:00 committed by Berkus Decker
parent 4598330506
commit 78a864c433
4 changed files with 24 additions and 19 deletions

View File

@ -97,3 +97,5 @@ SECTIONS
/DISCARD/ : { *(.comment) *(.gnu*) *(.note*) *(.eh_frame*) *(.text.boot*)}
}
INCLUDE linker/aarch64-exceptions.ld

View File

@ -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);

View File

@ -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

View File

@ -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);
}