From 90f5c86acbfcd1f19fd1245c96aa2c51be31361a Mon Sep 17 00:00:00 2001 From: Philippe Mathieu-Daudé Date: Sun, 26 Jan 2025 15:09:52 +0100 Subject: hw/loader: Pass ELFDATA endian order argument to load_elf_as() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Rather than passing a boolean 'is_big_endian' argument, directly pass the ELFDATA, which can be unspecified using the ELFDATANONE value. Update the call sites: 0 -> ELFDATA2LSB 1 -> ELFDATA2MSB Note, this allow removing the target_words_bigendian() call in the GENERIC_LOADER device, where we pass ELFDATANONE. Suggested-by: Richard Henderson Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson Message-Id: <20250127113824.50177-6-philmd@linaro.org> --- hw/avr/boot.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'hw/avr/boot.c') diff --git a/hw/avr/boot.c b/hw/avr/boot.c index 6a91dcd12d..e5a29c7218 100644 --- a/hw/avr/boot.c +++ b/hw/avr/boot.c @@ -73,7 +73,7 @@ bool avr_load_firmware(AVRCPU *cpu, MachineState *ms, bytes_loaded = load_elf_as(filename, NULL, NULL, NULL, &entry, NULL, NULL, - &e_flags, 0, EM_AVR, 0, 0, NULL); + &e_flags, ELFDATA2LSB, EM_AVR, 0, 0, NULL); if (bytes_loaded >= 0) { /* If ELF file is provided, determine CPU type reading ELF e_flags. */ const char *elf_cpu = avr_elf_e_flags_to_cpu_type(e_flags); -- cgit 1.4.1