From 47bc5ae90a1f27a7b0f92476e5eef0c65b1364d2 Mon Sep 17 00:00:00 2001 From: Ivan Velickovic Date: Tue, 27 Aug 2024 17:26:10 +1000 Subject: [PATCH] Improve missing ELF symbol error message Signed-off-by: Ivan Velickovic --- tool/microkit/src/main.rs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/tool/microkit/src/main.rs b/tool/microkit/src/main.rs index 07a8b2b3..cf86c382 100644 --- a/tool/microkit/src/main.rs +++ b/tool/microkit/src/main.rs @@ -470,7 +470,15 @@ pub fn pd_write_symbols( for (setvar_idx, setvar) in pd.setvars.iter().enumerate() { let value = pd_setvar_values[i][setvar_idx]; - elf.write_symbol(&setvar.symbol, &value.to_le_bytes())?; + let result = elf.write_symbol(&setvar.symbol, &value.to_le_bytes()); + if result.is_err() { + return Err(format!( + "No symbol named '{}' in ELF '{}' for PD '{}'", + setvar.symbol, + pd.program_image.display(), + pd.name + )); + } } }