summaryrefslogtreecommitdiff
path: root/kexec/crashdump.c
diff options
context:
space:
mode:
Diffstat (limited to 'kexec/crashdump.c')
-rw-r--r--kexec/crashdump.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/kexec/crashdump.c b/kexec/crashdump.c
index 0c10cf8..1cb8123 100644
--- a/kexec/crashdump.c
+++ b/kexec/crashdump.c
@@ -25,9 +25,28 @@
#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>
+#include <elf.h>
#include "kexec.h"
#include "crashdump.h"
+/* include "crashdump-elf.c" twice to create two functions from one */
+
+#define FUNC crash_create_elf64_headers
+#define EHDR Elf64_Ehdr
+#define PHDR Elf64_Phdr
+#include "crashdump-elf.c"
+#undef PHDR
+#undef EHDR
+#undef FUNC
+
+#define FUNC crash_create_elf32_headers
+#define EHDR Elf32_Ehdr
+#define PHDR Elf32_Phdr
+#include "crashdump-elf.c"
+#undef PHDR
+#undef EHDR
+#undef FUNC
+
/* Returns the physical address of start of crash notes buffer for a cpu. */
int get_crash_notes_per_cpu(int cpu, uint64_t *addr, uint64_t *len)
{