hw/core: skip loading debug on all failures

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 <richard.henderson@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Message-Id: <20231120150833.2552739-10-alex.bennee@linaro.org>
This commit is contained in:
Alex Bennée 2023-11-20 15:08:28 +00:00
parent 84dd7d88c9
commit 575aac007c

View File

@ -505,7 +505,7 @@ ssize_t load_elf_ram_sym(const char *filename,
clear_lsb, data_swab, as, load_rom, sym_cb); clear_lsb, data_swab, as, load_rom, sym_cb);
} }
if (ret != ELF_LOAD_FAILED) { if (ret > 0) {
debuginfo_report_elf(filename, fd, 0); debuginfo_report_elf(filename, fd, 0);
} }