From 0045e3250862d9632bab6c1b9f50bec7ee4e6cc4 Mon Sep 17 00:00:00 2001 From: bunnie Date: Fri, 1 Mar 2024 23:31:18 +0800 Subject: [PATCH] skip address tag embedded within the loadable program --- libs/xous-bio/src/lib.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libs/xous-bio/src/lib.rs b/libs/xous-bio/src/lib.rs index 452a05be5..58abed128 100644 --- a/libs/xous-bio/src/lib.rs +++ b/libs/xous-bio/src/lib.rs @@ -119,7 +119,8 @@ macro_rules! bio_code { report_api($name_start as u32); report_api($name_end as u32); } - unsafe { core::slice::from_raw_parts($name_start, ($name_end as usize) - ($name_start as usize))} + // skip the first 4 bytes, as they contain the loading offset + unsafe { core::slice::from_raw_parts($name_start.add(4), ($name_end as usize) - ($name_start as usize) - 4)} } core::arch::global_asm!(