diff --git a/osdk/src/base_crate/loongarch64.ld.template b/osdk/src/base_crate/loongarch64.ld.template index 01f8a9530..40796e9d2 100644 --- a/osdk/src/base_crate/loongarch64.ld.template +++ b/osdk/src/base_crate/loongarch64.ld.template @@ -33,6 +33,16 @@ SECTIONS *(.text .text.*) PROVIDE(__etext = .); } + + # The section to store exception table (ExTable). + # This table is used for recovering from specific exception handling faults + # occurring at known points in the code. + # Ref: /ostd/src/ex_table.rs + .ex_table : AT(ADDR(.ex_table) - KERNEL_VMA_OFFSET) { + __ex_table = .; + KEEP(*(SORT(.ex_table))) + __ex_table_end = .; + } .rodata : AT(ADDR(.rodata) - KERNEL_VMA_OFFSET) { *(.rodata .rodata.*)