From 198363c2d38ec34ffc3eacb824c5458830b9bb6a Mon Sep 17 00:00:00 2001 From: Ruihan Li Date: Tue, 2 Apr 2024 23:09:27 +0800 Subject: [PATCH] Speed up stack unwinding --- framework/aster-frame/Cargo.toml | 2 +- osdk/src/base_crate/x86_64.ld.template | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/framework/aster-frame/Cargo.toml b/framework/aster-frame/Cargo.toml index 93de16c29..944168a03 100644 --- a/framework/aster-frame/Cargo.toml +++ b/framework/aster-frame/Cargo.toml @@ -28,7 +28,7 @@ spin = "0.9.4" static_assertions = "1.1.0" tdx-guest = { path = "../libs/tdx-guest", optional = true } trapframe = { git = "https://github.com/asterinas/trapframe-rs", rev = "2f37590" } -unwinding = { version = "0.2.1", default-features = false, features = ["fde-static", "hide-trace", "panic", "personality", "unwinder"] } +unwinding = { version = "0.2.1", default-features = false, features = ["fde-gnu-eh-frame-hdr", "hide-trace", "panic", "personality", "unwinder"] } volatile = { version = "0.4.5", features = ["unstable"] } [target.x86_64-unknown-none.dependencies] diff --git a/osdk/src/base_crate/x86_64.ld.template b/osdk/src/base_crate/x86_64.ld.template index c2e6d0205..96ef9166b 100644 --- a/osdk/src/base_crate/x86_64.ld.template +++ b/osdk/src/base_crate/x86_64.ld.template @@ -28,6 +28,7 @@ SECTIONS .rodata : AT(ADDR(.rodata) - KERNEL_VMA) { *(.rodata .rodata.*) } .eh_frame_hdr : AT(ADDR(.eh_frame_hdr) - KERNEL_VMA) { + PROVIDE(__GNU_EH_FRAME_HDR = .); KEEP(*(.eh_frame_hdr .eh_frame_hdr.*)) } . = ALIGN(8); @@ -71,4 +72,4 @@ SECTIONS . = DATA_SEGMENT_END(.); __kernel_end = . - KERNEL_VMA; -} \ No newline at end of file +}