diff options
author | Gunnar Beutner <gbeutner@serenityos.org> | 2021-06-29 17:48:01 +0200 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2021-06-29 20:03:36 +0200 |
commit | 2016354c12c131fb42609448fbee089198f46028 (patch) | |
tree | 2a5201efed504ae8595c9bbac8831e3e84534f91 /Kernel | |
parent | d3127efc014baf2417b83a3298c155fd8b9da029 (diff) | |
download | serenity-2016354c12c131fb42609448fbee089198f46028.zip |
Kernel+LibCoreDump: Implement more x86_64 coredump functionality
Diffstat (limited to 'Kernel')
-rw-r--r-- | Kernel/CoreDump.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/Kernel/CoreDump.cpp b/Kernel/CoreDump.cpp index 2be0407c90..5e28718785 100644 --- a/Kernel/CoreDump.cpp +++ b/Kernel/CoreDump.cpp @@ -78,7 +78,11 @@ KResult CoreDump::write_elf_header() elf_file_header.e_ident[EI_MAG1] = 'E'; elf_file_header.e_ident[EI_MAG2] = 'L'; elf_file_header.e_ident[EI_MAG3] = 'F'; +#if ARCH(I386) elf_file_header.e_ident[EI_CLASS] = ELFCLASS32; +#else + elf_file_header.e_ident[EI_CLASS] = ELFCLASS64; +#endif elf_file_header.e_ident[EI_DATA] = ELFDATA2LSB; elf_file_header.e_ident[EI_VERSION] = EV_CURRENT; elf_file_header.e_ident[EI_OSABI] = 0; // ELFOSABI_NONE @@ -90,7 +94,11 @@ KResult CoreDump::write_elf_header() elf_file_header.e_ident[EI_PAD + 5] = 0; elf_file_header.e_ident[EI_PAD + 6] = 0; elf_file_header.e_type = ET_CORE; +#if ARCH(I386) elf_file_header.e_machine = EM_386; +#else + elf_file_header.e_machine = EM_X86_64; +#endif elf_file_header.e_version = 1; elf_file_header.e_entry = 0; elf_file_header.e_phoff = sizeof(ElfW(Ehdr)); |