]> git.proxmox.com Git - mirror_ubuntu-disco-kernel.git/commitdiff
csky: Add EM_CSKY_OLD 39
authorGuo Ren <ren_guo@c-sky.com>
Mon, 31 Dec 2018 14:27:29 +0000 (22:27 +0800)
committerGuo Ren <ren_guo@c-sky.com>
Mon, 31 Dec 2018 15:17:24 +0000 (23:17 +0800)
C-SKY historically used 39, the same value as MCORE, from which the
architecture was derived.

C-SKY binutils support both EM_CSKY and EM_CSKY_OLD, confirmed by
binutils:include/elf/common.h

Signed-off-by: Guo Ren <ren_guo@c-sky.com>
arch/csky/include/asm/elf.h

index d6dbc00e353331f441245125307430828c1eaf88..e1ec558278bc9bba3511d198aa3344415824ffc5 100644 (file)
@@ -8,6 +8,7 @@
 #include <abi/regdef.h>
 
 #define ELF_ARCH EM_CSKY
+#define EM_CSKY_OLD 39
 
 /* CSKY Relocations */
 #define R_CSKY_NONE               0
@@ -43,7 +44,8 @@ typedef elf_greg_t elf_gregset_t[ELF_NGREG];
 /*
  * This is used to ensure we don't load something for the wrong architecture.
  */
-#define elf_check_arch(x) ((x)->e_machine == ELF_ARCH)
+#define elf_check_arch(x) (((x)->e_machine == ELF_ARCH) || \
+                          ((x)->e_machine == EM_CSKY_OLD))
 
 /*
  * These are used to set parameters in the core dumps.