[PATCH] Fix the feature determining ELF32/ELF64 automatically

Ken'ichi Ohmichi oomichi at mxs.nes.nec.co.jp
Tue Nov 13 05:29:16 EST 2007


This patch fixes the problem that the kexec command cannot determine
ELF32/ELF64 automatically.

On i386 system, the kexec command always determined an ELF32 /proc/vmcore
even if the memory is 4GB or larger, because of referring the outside
of the array "range[]".

Ken'ichi Ohmichi

Signed-off-by: Ken'ichi Ohmichi <oomichi at mxs.nes.nec.co.jp>
diff -rpuN a/kexec/arch/i386/crashdump-x86.c b/kexec/arch/i386/crashdump-x86.c
--- a/kexec/arch/i386/crashdump-x86.c	2007-11-13 18:06:05.000000000 +0900
+++ b/kexec/arch/i386/crashdump-x86.c	2007-11-13 18:13:09.000000000 +0900
@@ -496,7 +496,7 @@ static enum coretype get_core_type(struc
 		if (ranges == 0)
 			return CORE_TYPE_ELF64;
-		if (range[ranges].end > 0xFFFFFFFFUL)
+		if (range[ranges - 1].end > 0xFFFFFFFFUL)
 			return CORE_TYPE_ELF64;
 			return CORE_TYPE_ELF32;

More information about the kexec mailing list