From 98dbe5aca8c328b40a0598d6ab478d9b869d1b5c Mon Sep 17 00:00:00 2001 From: Peter Crosthwaite Date: Sat, 29 Aug 2015 12:07:50 -0700 Subject: elf: Update EM_MOXIE definition EM_MOXIE now has a proper assigned elf code. Use it. Register the old interim value as EM_MOXIE_OLD and accept either in elf loading. Cc: Anthony Green Reviewed-by: Richard Henderson Signed-off-by: Peter Crosthwaite Signed-off-by: Paolo Bonzini --- include/elf.h | 3 +++ include/hw/elf_ops.h | 8 ++++++++ 2 files changed, 11 insertions(+) (limited to 'include') diff --git a/include/elf.h b/include/elf.h index 79859f0cd8..66add810df 100644 --- a/include/elf.h +++ b/include/elf.h @@ -135,6 +135,9 @@ typedef int64_t Elf64_Sxword; #define EM_TILEGX 191 /* TILE-Gx */ +#define EM_MOXIE 223 /* Moxie processor family */ +#define EM_MOXIE_OLD 0xFEED + /* This is the info that is needed to parse the dynamic section of the file */ #define DT_NULL 0 #define DT_NEEDED 1 diff --git a/include/hw/elf_ops.h b/include/hw/elf_ops.h index 0d41f249a0..0010c441d9 100644 --- a/include/hw/elf_ops.h +++ b/include/hw/elf_ops.h @@ -305,6 +305,14 @@ static int glue(load_elf, SZ)(const char *name, int fd, } } break; + case EM_MOXIE: + if (ehdr.e_machine != EM_MOXIE) { + if (ehdr.e_machine != EM_MOXIE_OLD) { + ret = ELF_LOAD_WRONG_ARCH; + goto fail; + } + } + break; default: if (elf_machine != ehdr.e_machine) { ret = ELF_LOAD_WRONG_ARCH; -- cgit v1.2.3