diff options
-rw-r--r-- | kexec/crashdump.h | 4 | ||||
-rw-r--r-- | kexec/kexec-elf.c | 4 |
2 files changed, 6 insertions, 2 deletions
diff --git a/kexec/crashdump.h b/kexec/crashdump.h index b6e60cc..31f711c 100644 --- a/kexec/crashdump.h +++ b/kexec/crashdump.h @@ -7,8 +7,8 @@ extern int get_xen_vmcoreinfo(uint64_t *addr, uint64_t *len); /* Need to find a better way to determine per cpu notes section size. */ #define MAX_NOTE_BYTES 1024 -/* Expecting ELF headers to fit in 4K. Increase it if you need more. */ -#define KCORE_ELF_HEADERS_SIZE 4096 +/* Expecting ELF headers to fit in 16K. Increase it if you need more. */ +#define KCORE_ELF_HEADERS_SIZE 16384 /* The address of the ELF header is passed to the secondary kernel * using the kernel command line option memmap=nnn. * The smallest unit the kernel accepts is in kilobytes, diff --git a/kexec/kexec-elf.c b/kexec/kexec-elf.c index 85d1765..1cdae36 100644 --- a/kexec/kexec-elf.c +++ b/kexec/kexec-elf.c @@ -8,6 +8,7 @@ #include <boot/elf_boot.h> #include "kexec.h" #include "kexec-elf.h" +#include "crashdump.h" static const int probe_debug = 0; @@ -389,6 +390,9 @@ static int build_mem_phdrs(const char *buf, off_t len, struct mem_ehdr *ehdr, phdr_size *= ehdr->e_phnum; if ((uintmax_t)(ehdr->e_phoff + phdr_size) > (uintmax_t)len) { /* The program header did not fit in the file buffer */ + fprintf(stderr, "%d segments require a %ld-byte buffer\n", + ehdr->e_phnum, ehdr->e_phoff + phdr_size); + fprintf(stderr, "KCORE_ELF_HEADERS_SIZE %d too small\n", KCORE_ELF_HEADERS_SIZE); if (probe_debug) { fprintf(stderr, "ELF program segment truncated\n"); } |