From ff84f60489fca46912bee67970cd17afba0660d7 Mon Sep 17 00:00:00 2001 From: Zejun Zhao Date: Wed, 29 Oct 2025 13:42:42 +0800 Subject: [PATCH] Add .ex_table section on loongarch64 platforms --- osdk/src/base_crate/loongarch64.ld.template | 10 ++++++++++ 1 file changed, 10 insertions(+) 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.*)