summaryrefslogtreecommitdiffstats
path: root/arch/powerpc/boot/elf_util.c
diff options
context:
space:
mode:
authorCédric Le Goater2014-04-24 09:23:35 +0200
committerBenjamin Herrenschmidt2014-04-28 09:36:04 +0200
commit002c39dba3fc47b953101790d798f69150366738 (patch)
tree484a2848cea7d6cb06fdaba2fd74d4ae861e346c /arch/powerpc/boot/elf_util.c
parentpowerpc/boot: Add 64bit and little endian support to addnote (diff)
downloadkernel-qcow2-linux-002c39dba3fc47b953101790d798f69150366738.tar.gz
kernel-qcow2-linux-002c39dba3fc47b953101790d798f69150366738.tar.xz
kernel-qcow2-linux-002c39dba3fc47b953101790d798f69150366738.zip
powerpc/boot: Add little endian support to elf utils
Signed-off-by: Cédric Le Goater <clg@fr.ibm.com> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Diffstat (limited to 'arch/powerpc/boot/elf_util.c')
-rw-r--r--arch/powerpc/boot/elf_util.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/arch/powerpc/boot/elf_util.c b/arch/powerpc/boot/elf_util.c
index 1567a0c0f05c..316552dea4d8 100644
--- a/arch/powerpc/boot/elf_util.c
+++ b/arch/powerpc/boot/elf_util.c
@@ -26,7 +26,11 @@ int parse_elf64(void *hdr, struct elf_info *info)
elf64->e_ident[EI_MAG2] == ELFMAG2 &&
elf64->e_ident[EI_MAG3] == ELFMAG3 &&
elf64->e_ident[EI_CLASS] == ELFCLASS64 &&
+#ifdef __LITTLE_ENDIAN__
+ elf64->e_ident[EI_DATA] == ELFDATA2LSB &&
+#else
elf64->e_ident[EI_DATA] == ELFDATA2MSB &&
+#endif
(elf64->e_type == ET_EXEC ||
elf64->e_type == ET_DYN) &&
elf64->e_machine == EM_PPC64))