arm64: ELF: add support for big-endian executables
authorWill Deacon <will.deacon@arm.com>
Fri, 11 Oct 2013 13:52:10 +0000 (14:52 +0100)
committerVictor Kamensky <victor.kamensky@linaro.org>
Fri, 14 Mar 2014 01:26:20 +0000 (18:26 -0700)
This patch adds support for the aarch64_be ELF format to the AArch64 ELF
loader.

Signed-off-by: Will Deacon <will.deacon@arm.com>
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
(cherry picked from commit 5436b5c8305b4ed37c5d11f96c1aaccca63c9ab2)

Signed-off-by: Victor Kamensky <victor.kamensky@linaro.org>
arch/arm64/include/asm/elf.h

index fe32c0e4ac010d4460184d7c8ddca2317b9d151e..aa57b15c9e86311d3cdf136f809dbb22205e3037 100644 (file)
@@ -92,11 +92,24 @@ typedef struct user_fpsimd_state elf_fpregset_t;
  * These are used to set parameters in the core dumps.
  */
 #define ELF_CLASS      ELFCLASS64
+#ifdef __AARCH64EB__
+#define ELF_DATA       ELFDATA2MSB
+#else
 #define ELF_DATA       ELFDATA2LSB
+#endif
 #define ELF_ARCH       EM_AARCH64
 
+/*
+ * This yields a string that ld.so will use to load implementation
+ * specific libraries for optimization.  This is more specific in
+ * intent than poking at uname or /proc/cpuinfo.
+ */
 #define ELF_PLATFORM_SIZE      16
+#ifdef __AARCH64EB__
+#define ELF_PLATFORM           ("aarch64_be")
+#else
 #define ELF_PLATFORM           ("aarch64")
+#endif
 
 /*
  * This is used to ensure we don't load something for the wrong architecture.