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 c2ac022b9..1f25ea9a0 100644 --- a/ceno_rt/src/lib.rs +++ b/ceno_rt/src/lib.rs @@ -68,6 +68,7 @@ pub fn halt(exit_code: u32) -> ! { ); } +// Look in the linker scripts `ceno_link.x` and `memory.x` for symbols like `_stack_start`. #[cfg(target_arch = "riscv32")] global_asm!( " @@ -98,8 +99,3 @@ _start: ecall ", ); - -extern "C" { - // The address of this variable is the start of the stack (growing downwards). - static _stack_start: u8; -}