Skip to content

Commit

Permalink
elf: On elf loading, treat both EM_MIPS and EM_NANOMIPS as legal for …
Browse files Browse the repository at this point in the history
…MIPS

Modify load_elf32()/load_elf64() to treat EM_NANOMIPS as legal as
EM_MIPS is.

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Aleksandar Markovic <amarkovic@wavecomp.com>
Signed-off-by: Aleksandar Markovic <amarkovic@wavecomp.com>
Signed-off-by: Stefan Markovic <smarkovic@wavecomp.com>
  • Loading branch information
Aleksandar Rikalo authored and AMarkovic committed Aug 24, 2018
1 parent f72541f commit 56f2604
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions include/hw/elf_ops.h
Original file line number Diff line number Diff line change
Expand Up @@ -327,6 +327,14 @@ static int glue(load_elf, SZ)(const char *name, int fd,
}
}
break;
case EM_MIPS:
case EM_NANOMIPS:
if ((ehdr.e_machine != EM_MIPS) &&
(ehdr.e_machine != EM_NANOMIPS)) {
ret = ELF_LOAD_WRONG_ARCH;
goto fail;
}
break;
default:
if (elf_machine != ehdr.e_machine) {
ret = ELF_LOAD_WRONG_ARCH;
Expand Down

0 comments on commit 56f2604

Please sign in to comment.