about summary refs log tree commit diff
diff options
context:
space:
mode:
authorzhaixiaojuan <zhaixiaojuan@loongson.cn>2023-02-03 16:24:11 +0800
committerwangrui <wangrui@loongson.cn>2023-04-08 00:09:54 +0800
commitbf1758d229d08a1a40fb78c0031bba26060a8fe6 (patch)
tree133f318321bbc73fb4fd9ee0df845c789ee51d6f
parent737e1d25692ff57699fddb379d62dd6ec1cb2006 (diff)
downloadrust-bf1758d229d08a1a40fb78c0031bba26060a8fe6.tar.gz
rust-bf1758d229d08a1a40fb78c0031bba26060a8fe6.zip
Define UNWIND_DATA_REG for loongarch64
-rw-r--r--library/std/src/personality/gcc.rs3
1 files changed, 3 insertions, 0 deletions
diff --git a/library/std/src/personality/gcc.rs b/library/std/src/personality/gcc.rs
index 41c0fe725a5..0421b47be02 100644
--- a/library/std/src/personality/gcc.rs
+++ b/library/std/src/personality/gcc.rs
@@ -77,6 +77,9 @@ const UNWIND_DATA_REG: (i32, i32) = (0, 1); // R0, R1
 #[cfg(any(target_arch = "riscv64", target_arch = "riscv32"))]
 const UNWIND_DATA_REG: (i32, i32) = (10, 11); // x10, x11
 
+#[cfg(target_arch = "loongarch64")]
+const UNWIND_DATA_REG: (i32, i32) = (4, 5); // a0, a1
+
 // The following code is based on GCC's C and C++ personality routines.  For reference, see:
 // https://github.com/gcc-mirror/gcc/blob/master/libstdc++-v3/libsupc++/eh_personality.cc
 // https://github.com/gcc-mirror/gcc/blob/trunk/libgcc/unwind-c.c