summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--kexec/arch/i386/crashdump-x86.c10
-rw-r--r--kexec/arch/i386/kexec-elf-x86.c11
2 files changed, 19 insertions, 2 deletions
diff --git a/kexec/arch/i386/crashdump-x86.c b/kexec/arch/i386/crashdump-x86.c
index e469c1d..9984bec 100644
--- a/kexec/arch/i386/crashdump-x86.c
+++ b/kexec/arch/i386/crashdump-x86.c
@@ -705,7 +705,15 @@ int load_crashdump_segments(struct kexec_info *info, char* mod_cmdline,
if (prepare_crash_memory_elf32_headers(info, tmp, sz) < 0)
return -1;
}
- elfcorehdr = add_buffer(info, tmp, sz, sz, align, min_base,
+
+ /* Hack: With some ld versions (GNU ld version 2.14.90.0.4 20030523),
+ * 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
+ * elf core header segment to 16K to avoid being placed in such gaps.
+ * This is a makeshift solution until it is fixed in kernel.
+ */
+ elfcorehdr = add_buffer(info, tmp, sz, 16*1024, align, min_base,
max_addr, 1);
if (delete_memmap(memmap_p, elfcorehdr, sz) < 0)
return -1;
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 */