summaryrefslogtreecommitdiff
path: root/kexec/arch/i386/kexec-elf-x86.c
diff options
context:
space:
mode:
authorVivek Goyal <vgoyal@in.ibm.com>2005-08-04 17:56:51 +0530
committerEric W. Biederman <ebiederm@xmission.com>2006-07-27 09:43:20 -0600
commit7d142115e31c566cd3b333c84834b4dbd100c43e (patch)
treed7bfdd8062c3358c90087702936954769fb63115 /kexec/arch/i386/kexec-elf-x86.c
parent71b37c87c709970c62924c58fe436857d569fe80 (diff)
Hack to avoid kexec segment stomping
o This is temporary hack patch to avoid any kexec segment being put in small memory hole between data and bss segments (Valid only for some older ld versions). This data is stomped by new kernel as kernel somehow thinks it to be part of bss. o This should be removed once the problem is fixed at kernel level. Signed-off-by: Vivek Goyal <vgoyal@in.ibm.com> Signed-off-by: Maneesh Soni <maneesh@in.ibm.com>
Diffstat (limited to 'kexec/arch/i386/kexec-elf-x86.c')
-rw-r--r--kexec/arch/i386/kexec-elf-x86.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/kexec/arch/i386/kexec-elf-x86.c b/kexec/arch/i386/kexec-elf-x86.c
index 02dd70a..6308f4e 100644
--- a/kexec/arch/i386/kexec-elf-x86.c
+++ b/kexec/arch/i386/kexec-elf-x86.c
@@ -227,7 +227,16 @@ int elf_x86_load(int argc, char **argv, const char *buf, off_t len,
/* Get the linux parameter header */
hdr = xmalloc(sizeof(*hdr));
- param_base = add_buffer(info, hdr, sizeof(*hdr), sizeof(*hdr),
+
+ /* Hack: With some ld versions, vmlinux program headers show
+ * a gap of two pages between bss segment and data segment
+ * but effectively kernel considers it as bss segment and
+ * overwrites the any data placed there. Hence bloat the
+ * memsz of parameter segment to 16K to avoid being placed
+ * in such gaps.
+ * This is a makeshift solution until it is fixed in kernel
+ */
+ param_base = add_buffer(info, hdr, sizeof(*hdr), 16*1024,
16, 0, max_addr, 1);
/* Initialize the parameter header */