From e3ed41ff32ff861330130fafb3b93a7a0e7ee34b Mon Sep 17 00:00:00 2001 From: occheung Date: Wed, 1 Jun 2022 18:35:50 +0800 Subject: [PATCH] fix index table reference type --- src/libdyld/src/lib.rs | 2 +- src/runtime/src/kernel/core1.rs | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/libdyld/src/lib.rs b/src/libdyld/src/lib.rs index 5b11b8ca..a4621bd3 100644 --- a/src/libdyld/src/lib.rs +++ b/src/libdyld/src/lib.rs @@ -138,7 +138,7 @@ impl Library { reloc::rebind(self.arch, self, name, addr as Elf32_Word) } - pub fn exidx(&self) -> &[u32] { + pub fn exidx(&self) -> &[EXIDX_Entry] { self.image.get_ref_slice_unchecked(&self.exidx) } } diff --git a/src/runtime/src/kernel/core1.rs b/src/runtime/src/kernel/core1.rs index 1ebee9ee..70942050 100644 --- a/src/runtime/src/kernel/core1.rs +++ b/src/runtime/src/kernel/core1.rs @@ -13,7 +13,7 @@ use libcortex_a9::{ }; use libboard_zynq::{mpcore, gic}; use libsupport_zynq::ram; -use dyld::{self, Library}; +use dyld::{self, Library, elf::EXIDX_Entry}; use crate::{eh_artiq, get_async_errors, rtio}; use super::{ api::resolve, @@ -31,8 +31,8 @@ use super::{ extern "C" { static __text_start: u32; static __text_end: u32; - static __exidx_start: u32; - static __exidx_end: u32; + static __exidx_start: EXIDX_Entry; + static __exidx_end: EXIDX_Entry; } unsafe fn attribute_writeback(typeinfo: *const ()) { @@ -217,10 +217,10 @@ pub fn terminate(exceptions: &'static [Option>], #[no_mangle] extern fn dl_unwind_find_exidx(pc: *const u32, len_ptr: *mut u32) -> *const u32 { let length; - let start: *const u32; + let start: *const EXIDX_Entry; unsafe { if &__text_start as *const u32 <= pc && pc < &__text_end as *const u32 { - length = (&__exidx_end as *const u32).offset_from(&__exidx_start) as u32; + length = (&__exidx_end as *const EXIDX_Entry).offset_from(&__exidx_start) as u32; start = &__exidx_start; } else { let exidx = KERNEL_IMAGE.as_ref() @@ -231,7 +231,7 @@ extern fn dl_unwind_find_exidx(pc: *const u32, len_ptr: *mut u32) -> *const u32 } *len_ptr = length; } - start + start as *const u32 } pub extern fn rtio_get_destination_status(destination: i32) -> bool {