1

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

0

2 Answers 2

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.

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

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.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.