To extract the uncompressed kernel from the kernel image, you can use the extract-vmlinux
script from the scripts
directory in the kernel tree (available at least in kernel version 3.5) (if you get an error like
mktemp: Cannot create temp file /tmp/vmlinux-XXX: Invalid argument
you need to replace $(mktemp /tmp/vmlinux-XXX)
by $(mktemp /tmp/vmlinux-XXXXXX)
in the script). The command is /path/to/kernel/tree/scripts/extract-vmlinux <kernel image> >vmlinux
.
If the extracted kernel binary contains symbol information, you should1 be able to create the System.map
file using the mksysmap
script from the same subdirectory. The command here is NM=nm /path/to/kernel/tree/scripts/mksysmap vmlinux System.map
.
1 The kernel images shipped with my distribution seem to be stripped, so the script was not able to get the symbols.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…