From b92b1e18a97135684907d238578146f7aabacc84 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alessandro=C2=A0Decina?= Date: Thu, 3 Jun 2021 10:14:47 +0000 Subject: [PATCH] aya: improve call relocation error messages --- aya/src/obj/relocation.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/aya/src/obj/relocation.rs b/aya/src/obj/relocation.rs index 24138150..a18480d6 100644 --- a/aya/src/obj/relocation.rs +++ b/aya/src/obj/relocation.rs @@ -28,8 +28,8 @@ enum RelocationError { symbol_name: Option, }, - #[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)?;