> diff --git a/linux-user/elfload.c b/linux-user/elfload.c
> index 2832a33..9399e44 100644
> --- a/linux-user/elfload.c
> +++ b/linux-user/elfload.c
> @@ -1662,6 +1662,11 @@ int load_elf_binary(struct linux_binprm * bprm,
> struct target_pt_regs * regs,
> when we load the interpreter. */
> elf_ex = *(struct elfhdr *)bprm->buf;
>
> +#if defined(TARGET_MIPS64)
> + if ((elf_ex.e_flags & EF_MIPS_MARCH) == E_MIPS_MACH_OCTEON) {
> + info->elf_arch = 1;
> + }
> +#endif
> +++ b/linux-user/main.c
> @@ -3348,6 +3348,11 @@ int main(int argc, char **argv, char **envp)
> if (regs->cp0_epc & 1) {
> env->hflags |= MIPS_HFLAG_M16;
> }
> +#if defined(TARGET_MIPS64)
> + if (info->elf_arch) {
> + env->insn_flags |= INSN_OCTEON;
> + }
> +#endif
> }