]> xenbits.xensource.com Git - qemu-xen.git/commitdiff
elf: Update EM_MOXIE definition
authorPeter Crosthwaite <crosthwaite.peter@gmail.com>
Sat, 29 Aug 2015 19:07:50 +0000 (12:07 -0700)
committerPaolo Bonzini <pbonzini@redhat.com>
Fri, 25 Sep 2015 10:04:43 +0000 (12:04 +0200)
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 <green@moxielogic.com>
Reviewed-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Peter Crosthwaite <crosthwaite.peter@gmail.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
hw/moxie/moxiesim.c
include/elf.h
include/hw/elf_ops.h
target-moxie/cpu.h

index a3d1a1ba2a8fa2b9f8d2670e01bfc2bd597cad8f..4e98c20f23fb5533f8110fefe644b537a641839b 100644 (file)
@@ -34,6 +34,7 @@
 #include "hw/loader.h"
 #include "hw/char/serial.h"
 #include "exec/address-spaces.h"
+#include "elf.h"
 
 #define PHYS_MEM_BASE 0x80000000
 
index 79859f0cd8164e587e6ace6205fe4570bb14b70b..66add810df14461a41a063f9de4740979b4102f9 100644 (file)
@@ -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
index 0d41f249a03ae5491a847c11b876bbaf85cddc5b..0010c441d94d5f36c7e3029a7ae488107bb99de8 100644 (file)
@@ -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;
index 15ca15bf53ac8faa83d1d7d58bb9cecee8c81f32..7d47e0d95692ca5109dc48e9d62b0877cb8dc105 100644 (file)
@@ -26,7 +26,7 @@
 
 #define CPUArchState struct CPUMoxieState
 
-#define ELF_MACHINE     0xFEED /* EM_MOXIE */
+#define ELF_MACHINE     EM_MOXIE
 
 #define MOXIE_EX_DIV0        0
 #define MOXIE_EX_BAD         1