What I know (please correct if my understanding is wrong):

vmlinuz: is a compressed, self-extracting, bootable Linux image. Always ELF? Generated how?

zImage (or bzImage): are compressed, self-extracting, bootable Linux image. Always binary. Generated by “make zImage” .

Some sources say that it is the actually the same image eg: here and here.

but it doesn't look so. I have build embedded Openwrt project and got this info when doing "file vmlinuz":

vmlinuz: ELF 32-bit MSB  executable, MIPS, MIPS32 rel2 version 1 (SYSV), statically linked, stripped

as can be seen it is in ELF format and NOT a binary as zImage.

to add to confusion, when I do readelf on my ubuntu vmlinuz, I get that it is not an ELF file.


vmlinuz is the same.

You will notice this if you ever run make install. The zImage or bzImage is what's installed to /boot/vmlinuz-$VERSION.

It looks like some architectures wrap it as ELF (and some don't). Linux on x86 probably stuck without ELF for compatibility with the bootloader e.g. LILO, syslinux etc. And maybe they don't prefer how GRUB loads ELF files, I don't know. On other architectures it may be stuck with ELF for the same reason. Note the decompressed image will always be ELF (see e.g.).

Not the answer you're looking for? Browse other questions tagged or ask your own question.