From 6ce57e5c52e94fdbeb1ff36d1cb94d0b806b1450 Mon Sep 17 00:00:00 2001 From: Matthias Goergens Date: Mon, 16 Dec 2024 18:29:52 +0800 Subject: [PATCH 1/2] Remove unnecessary `_stack_start` from Rust code --- ceno_rt/ceno_link.x | 1 + ceno_rt/src/lib.rs | 5 ----- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/ceno_rt/ceno_link.x b/ceno_rt/ceno_link.x index 956531d41..a12c3f226 100644 --- a/ceno_rt/ceno_link.x +++ b/ceno_rt/ceno_link.x @@ -1,4 +1,5 @@ +/* The address of this variable is the start of the stack (growing downwards). */ _stack_start = ORIGIN(REGION_STACK) + LENGTH(REGION_STACK); _hints_start = ORIGIN(REGION_HINTS); _hints_length = LENGTH(REGION_HINTS); diff --git a/ceno_rt/src/lib.rs b/ceno_rt/src/lib.rs index 7e3c8e1ba..51f233ac1 100644 --- a/ceno_rt/src/lib.rs +++ b/ceno_rt/src/lib.rs @@ -84,8 +84,3 @@ unsafe extern "C" fn _start_rust() -> ! { bespoke_entrypoint(); halt(0) } - -extern "C" { - // The address of this variable is the start of the stack (growing downwards). - static _stack_start: u8; -} From d642e0b739208bda0d9f25d720d262d8be629ff2 Mon Sep 17 00:00:00 2001 From: Matthias Goergens Date: Wed, 18 Dec 2024 14:09:03 +0800 Subject: [PATCH 2/2] Doc --- ceno_rt/src/lib.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/ceno_rt/src/lib.rs b/ceno_rt/src/lib.rs index ad07851c0..7923204f3 100644 --- a/ceno_rt/src/lib.rs +++ b/ceno_rt/src/lib.rs @@ -37,6 +37,7 @@ pub fn halt(exit_code: u32) -> ! { unreachable!(); } +// Look in the linker scripts `ceno_link.x` and `memory.x` for symbols like `_stack_start`. global_asm!( " // The entry point for the program.