# Final Image format The main binary is bastion.elf (in some cases it calls kernel.elf). It has format of ELF64 ## Why ELF64? ELF is the basic executable format for unix-like, and this format is very easy for understandable. Also elf is what Clang/GCC emit by default when targeting Linux or bare-metal. And GDB/LLDB has great understanding of ELF format. ## What format is Linux image Linux has its own format for each architecture. For example for x86: bzImage layout: ┌──────────────────────┐ │ Real-mode boot header│ "Boot protocol" setup header │ (struct boot_params) │ at offset 0x1F1 ├──────────────────────┤ │ PE/COFF header │ Grafted on if CONFIG_EFI_STUB=y │ (optional) │ so UEFI can load it directly ├──────────────────────┤ │ Compressed kernel │ The actual vmlinux (ELF), compressed │ (gzip/lz4/zstd) │ with a small decompressor stub ├──────────────────────┤ │ Decompressor code │ Runs in protected/long mode, │ │ decompresses → real vmlinux └──────────────────────┘ for aarch64, kernel Image is a flat binary with 64-byte header defined by the ARM64 boot protocol (with efi_stub config it also can have PE header).