瀏覽代碼

aya: improve call relocation error messages

Alessandro Decina 3 年之前
父節點
當前提交
b92b1e18a9
共有 1 個文件被更改,包括 3 次插入2 次删除
  1. 3 2
      aya/src/obj/relocation.rs

+ 3 - 2
aya/src/obj/relocation.rs

@@ -28,8 +28,8 @@ enum RelocationError {
         symbol_name: Option<String>,
     },
 
-    #[error("function {address:#x} not found")]
-    UnknownFunction { address: u64 },
+    #[error("function {address:#x} not found while relocating `{caller_name}`")]
+    UnknownFunction { address: u64, caller_name: String },
 
     #[error("the map `{name}` at section `{section_index}` has not been created")]
     MapNotCreated { section_index: usize, name: String },
@@ -278,6 +278,7 @@ impl<'a> FunctionLinker<'a> {
                     .get(&callee_address)
                     .ok_or(RelocationError::UnknownFunction {
                         address: callee_address,
+                        caller_name: fun.name.clone(),
                     })?;
             let callee_ins_index = self.link_function(program, callee)?;