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

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