Blame SOURCES/kexec-tools-2.0.7-ppc64-kdump-Fix-ELF-header-endianess.patch

de80c6
From 45b33eb2e70cd44f41abf1058a92659cb4315011 Mon Sep 17 00:00:00 2001
de80c6
From: Laurent Dufour <ldufour@linux.vnet.ibm.com>
de80c6
Date: Fri, 25 Jul 2014 17:07:49 +0200
de80c6
Subject: [PATCH] ppc64/kdump: Fix ELF header endianess
de80c6
de80c6
The ELF header created among the loading of the kdump kernel should be
de80c6
flagged using the current endianess and not always as big endian.
de80c6
de80c6
Without this patch the data exposed in /proc/vmcore are not readable when
de80c6
running in LE mode.
de80c6
de80c6
Signed-off-by: Laurent Dufour <ldufour@linux.vnet.ibm.com>
de80c6
Signed-off-by: Simon Horman <horms@verge.net.au>
de80c6
---
de80c6
 kexec/arch/ppc64/crashdump-ppc64.c | 4 ++++
de80c6
 1 file changed, 4 insertions(+)
de80c6
de80c6
diff --git a/kexec/arch/ppc64/crashdump-ppc64.c b/kexec/arch/ppc64/crashdump-ppc64.c
de80c6
index 00a0e63..6214b83 100644
de80c6
--- a/kexec/arch/ppc64/crashdump-ppc64.c
de80c6
+++ b/kexec/arch/ppc64/crashdump-ppc64.c
de80c6
@@ -38,7 +38,11 @@
de80c6
 static struct crash_elf_info elf_info64 =
de80c6
 {
de80c6
 	class: ELFCLASS64,
de80c6
+#if BYTE_ORDER == LITTLE_ENDIAN
de80c6
+	data: ELFDATA2LSB,
de80c6
+#else
de80c6
 	data: ELFDATA2MSB,
de80c6
+#endif
de80c6
 	machine: EM_PPC64,
de80c6
 	page_offset: PAGE_OFFSET,
de80c6
 	lowmem_limit: MAXMEM,
de80c6
-- 
de80c6
1.9.3
de80c6