From: Philippe Mathieu-Daudé <[email protected]> MicroBlaze CPU model has a "little-endian" property, pointing to the @endi internal field. Commit c36ec3a9655 ("hw/microblaze: Explicit CPU endianness") took care of having all MicroBlaze boards with an explicit default endianness (similarly with commit 91fc6d8101d for linux-user binaries), so later commit 415aae543ed ("target/microblaze: Consider endianness while translating code") could infer the endianness at runtime from the @endi field, and not a compile time via the TARGET_BIG_ENDIAN definition. Doing so, we forgot to propagate that runtime change to the disassemble_info structure. Do it now to display the opcodes in correct endianness order.
Cc: [email protected] Fixes: 415aae543ed ("target/microblaze: Consider endianness while translating code") Signed-off-by: Philippe Mathieu-Daudé <[email protected]> Reviewed-by: Richard Henderson <[email protected]> Reviewed-by: Pierrick Bouvier <[email protected]> Message-Id: <[email protected]> (cherry picked from commit 41c417290df91c31a70adeb8f5271896a8c5f802) Signed-off-by: Michael Tokarev <[email protected]> diff --git a/target/microblaze/cpu.c b/target/microblaze/cpu.c index f3bebea856..5fec3819dc 100644 --- a/target/microblaze/cpu.c +++ b/target/microblaze/cpu.c @@ -226,8 +226,8 @@ static void mb_disas_set_info(CPUState *cpu, disassemble_info *info) { info->mach = bfd_arch_microblaze; info->print_insn = print_insn_microblaze; - info->endian = TARGET_BIG_ENDIAN ? BFD_ENDIAN_BIG - : BFD_ENDIAN_LITTLE; + info->endian = MICROBLAZE_CPU(cpu)->cfg.endi ? BFD_ENDIAN_LITTLE + : BFD_ENDIAN_BIG; } static void mb_cpu_realizefn(DeviceState *dev, Error **errp) -- 2.47.3
