fix warnings, give empty section if nothing found

This commit is contained in:
mwojcik 2022-10-12 16:31:27 +08:00
parent 93bd98f6c0
commit d080c65519
1 changed files with 3 additions and 4 deletions

View File

@ -5,7 +5,6 @@ use alloc::borrow::ToOwned;
use log::{debug, info, error}; use log::{debug, info, error};
use cslice::CSlice; use cslice::CSlice;
use libregister::RegisterR;
use libcortex_a9::{ use libcortex_a9::{
enable_fpu, enable_fpu,
cache::{dcci_slice, iciallu, bpiall}, 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 length;
let start: *const EXIDX_Entry; let start: *const EXIDX_Entry;
unsafe { 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; length = (&__exidx_end as *const EXIDX_Entry).offset_from(&__exidx_start) as u32;
start = &__exidx_start; start = &__exidx_start;
} else if KERNEL_IMAGE != ptr::null() { } 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; length = exidx.len() as u32;
start = exidx.as_ptr(); start = exidx.as_ptr();
} else { } else {
*len_ptr = 0; length = 0;
return 0 as *const u32; start = ptr::null();
} }
*len_ptr = length; *len_ptr = length;
} }