If the Linux kernel by itself is an ELF file, where can I find its ELF file?


2 Answers 2


On many systems you can find a compressed kernel in /boot, typically named vmlinuz-$(uname -r). The ELF executable contained therein can be extracted using the extract-vmlinux script, available in the kernel source code:

extract-vmlinux /boot/vmlinuz-$(uname -r) > vmlinux

The result is an ELF file:

$ file vmlinux
vmlinux: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), statically linked, BuildID[sha1]=b28d236fad2fb7d0eb9bbe6eac766fb04406da3f, stripped

(on x86-64).

If you’re building the kernel,

make vmlinux

will produce the ELF executable.

  • make vmlinux doesn't work. What makefile are you using? Sep 22, 2020 at 10:45
  • The kernel’s Makefile. Sep 22, 2020 at 11:04

On a desktop/server you will usually find the kernel in /boot.

Look for a file called vmlinuz-* (depends on your distribution).

How the kernel is loaded: https://www.kernel.org/doc/html/latest/admin-guide/initrd.html

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .