On 02 Feb 2022 11:17, Dragan Mladjenovic wrote: > --- a/sim/mips/configure.ac > +++ b/sim/mips/configure.ac > @@ -216,6 +227,7 @@ if test ${sim_gen} = MULTI; then > #include "sim-main.h" > #include "multi-include.h" > #include "elf-bfd.h" > +#include "elfxx-mips.h" > #include "elf/mips.h" > > #define SD sd > @@ -235,7 +247,11 @@ sim_engine_run (SIM_DESC sd, > & EF_MIPS_ARCH_ASE_MICROMIPS) > mach = bfd_mach_mips_micromips; > else > - mach = STATE_ARCHITECTURE (SD)->mach; > + { > + mach = _bfd_elf_mips_mach (elf_elfheader (STATE_PROG_BFD (sd))->e_flags); > + if (!mach) > + mach = STATE_ARCHITECTURE (SD)->mach; > + } why do you need this logic in the main engine run routine ? why isn't the STATE_ARCHITECTURE value already set to the correct value ? if it isn't set correctly all the time, this can lead to incorrect behavior elsewhere when code checks it. when the sim is opened, the bfd_mach is either explicitly passed in (which gdb does), or initialized with a call to the bfd library APIs. see the sim/common/sim-utils.c:sim_analyze_program code. -mike