From 575aac007cfa5a28315f5c5658d3cf64cd6a5de4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alex=20Benn=C3=A9e?= Date: Mon, 20 Nov 2023 15:08:28 +0000 Subject: [PATCH] hw/core: skip loading debug on all failures MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ELF_LOAD_FAILED is one of many negative return codes we can have. Lets treat any positive size_t as a success for loading. Reviewed-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Alex Bennée Message-Id: <20231120150833.2552739-10-alex.bennee@linaro.org> --- hw/core/loader.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/core/loader.c b/hw/core/loader.c index 3c79283777..e7a9b3775b 100644 --- a/hw/core/loader.c +++ b/hw/core/loader.c @@ -505,7 +505,7 @@ ssize_t load_elf_ram_sym(const char *filename, clear_lsb, data_swab, as, load_rom, sym_cb); } - if (ret != ELF_LOAD_FAILED) { + if (ret > 0) { debuginfo_report_elf(filename, fd, 0); }