Readings

Get GCC from a Linux release

0. extract-vmlinux

Download vmlinux-extractor script, which extracts the ELF binary from the zlib-compressed vmlinuz file.

curl -sLO https://raw.githubusercontent.com/torvalds/linux/master/scripts/extract-vmlinux

1. Download the image package

For example, a CentOS-released one:

curl -sLO http://archive.kernel.org/centos-vault/7.2.1511/os/x86_64/Packages/kernel-3.10.0-327.el7.x86_64.rpm

Extract to CPIO, and uncompress it:

rpm2cpio kernel-3.10.0-327.el7.x86_64.rpm | cpio -idmv

2. Extract the ELF binary:

Extract the Linux ELF binary:

./extract-vmlinux ./kernel-3.10.0-327.el7.x86_64/boot/vmlinuz-3.10.0-327.el7.x86_64 > ./kernel-3.10.0-327.el7.x86_64/vmlinux-3.10.0-327.el7.x86_64

3. Dissect the binary:

objdump \
 --full-contents \
 --section .comment \
 ./kernel-3.10.0-327.el7.x86_64/vmlinux-3.10.0-327.el7.x86_64