summaryrefslogtreecommitdiffstats
path: root/arch/powerpc/include
diff options
context:
space:
mode:
authorAnton Blanchard <anton@samba.org>2013-08-07 02:01:50 +1000
committerBenjamin Herrenschmidt <benh@kernel.crashing.org>2013-08-14 15:33:39 +1000
commit8bd0b119ae64bf448e5f45d208007950e0ac2754 (patch)
treec792cadc7f7fa17c5e36d119e486878906af47a4 /arch/powerpc/include
parenta02f6dfc954ed2308a2809e37c2f262d52b82a2b (diff)
downloadlinux-8bd0b119ae64bf448e5f45d208007950e0ac2754.tar.bz2
powerpc: Fix little endian coredumps
We need to set ELF_DATA correctly on LE coredumps. Signed-off-by: Anton Blanchard <anton@samba.org> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Diffstat (limited to 'arch/powerpc/include')
-rw-r--r--arch/powerpc/include/uapi/asm/elf.h8
1 files changed, 6 insertions, 2 deletions
diff --git a/arch/powerpc/include/uapi/asm/elf.h b/arch/powerpc/include/uapi/asm/elf.h
index 89fa042d51db..7e39c9146a71 100644
--- a/arch/powerpc/include/uapi/asm/elf.h
+++ b/arch/powerpc/include/uapi/asm/elf.h
@@ -109,7 +109,6 @@ typedef elf_gregset_t32 compat_elf_gregset_t;
# define ELF_GREG_TYPE elf_greg_t64
# define ELF_ARCH EM_PPC64
# define ELF_CLASS ELFCLASS64
-# define ELF_DATA ELFDATA2MSB
typedef elf_greg_t64 elf_greg_t;
typedef elf_gregset_t64 elf_gregset_t;
#else
@@ -118,11 +117,16 @@ typedef elf_gregset_t64 elf_gregset_t;
# define ELF_GREG_TYPE elf_greg_t32
# define ELF_ARCH EM_PPC
# define ELF_CLASS ELFCLASS32
-# define ELF_DATA ELFDATA2MSB
typedef elf_greg_t32 elf_greg_t;
typedef elf_gregset_t32 elf_gregset_t;
#endif /* __powerpc64__ */
+#ifdef __BIG_ENDIAN__
+#define ELF_DATA ELFDATA2MSB
+#else
+#define ELF_DATA ELFDATA2LSB
+#endif
+
/* Floating point registers */
typedef double elf_fpreg_t;
typedef elf_fpreg_t elf_fpregset_t[ELF_NFPREG];