From d080c65519b05d10fcef66874ba745e34b76d7cb Mon Sep 17 00:00:00 2001 From: mwojcik Date: Wed, 12 Oct 2022 16:31:27 +0800 Subject: [PATCH] fix warnings, give empty section if nothing found --- src/runtime/src/kernel/core1.rs | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/runtime/src/kernel/core1.rs b/src/runtime/src/kernel/core1.rs index 7836784..661a603 100644 --- a/src/runtime/src/kernel/core1.rs +++ b/src/runtime/src/kernel/core1.rs @@ -5,7 +5,6 @@ use alloc::borrow::ToOwned; use log::{debug, info, error}; use cslice::CSlice; -use libregister::RegisterR; use libcortex_a9::{ enable_fpu, cache::{dcci_slice, iciallu, bpiall}, @@ -220,7 +219,7 @@ extern fn dl_unwind_find_exidx(pc: *const u32, len_ptr: *mut u32) -> *const u32 let length; let start: *const EXIDX_Entry; unsafe { - if (&__text_start as *const u32 <= pc && pc < &__text_end as *const u32) { + if &__text_start as *const u32 <= pc && pc < &__text_end as *const u32 { length = (&__exidx_end as *const EXIDX_Entry).offset_from(&__exidx_start) as u32; start = &__exidx_start; } else if KERNEL_IMAGE != ptr::null() { @@ -230,8 +229,8 @@ extern fn dl_unwind_find_exidx(pc: *const u32, len_ptr: *mut u32) -> *const u32 length = exidx.len() as u32; start = exidx.as_ptr(); } else { - *len_ptr = 0; - return 0 as *const u32; + length = 0; + start = ptr::null(); } *len_ptr = length; }