我想从 u-boot图像中提取内核符号
最终目标是使用 gdb
调试系统调用内核使用CONFIG_DEBUG_INFO=y
进行编译, gcc 正在使用 -g 选项(我已选中)
make uImage
后,我:
# file arch/arm/boot/*
arch/arm/boot/bootp: directory
arch/arm/boot/compressed: directory
arch/arm/boot/Image: data
arch/arm/boot/install.sh: POSIX shell script text executable
arch/arm/boot/Makefile: ASCII English text
arch/arm/boot/uImage: u-boot legacy uImage, Linux-3.0.6, Linux/ARM, OS Kernel Image (Not compressed), 3044476 bytes, Thu Mar 22 18:13:40 2012, Load Address: 0x00008000, Entry Point: 0x00008000, Header CRC: 0xF689B805, Data CRC: 0x6BFE76DF
arch/arm/boot/zImage: data
gdb 无法直接加载 uImage
我尝试了这个脚本http://forum.xda-developers.com/showthread.php?t=901152。
# file arch/arm/boot/zImage_unpacked/*
arch/arm/boot/zImage_unpacked/decompression_code: data
arch/arm/boot/zImage_unpacked/initramfs.cpio+part3: data
arch/arm/boot/zImage_unpacked/kernel.img: data
arch/arm/boot/zImage_unpacked/padding_piggy: data
arch/arm/boot/zImage_unpacked/piggy: data
arch/arm/boot/zImage_unpacked/piggy.gz: gzip compressed data, from Unix, max compression
arch/arm/boot/zImage_unpacked/piggy.gz+piggy_trailer: gzip compressed data, from Unix, max compression
arch/arm/boot/zImage_unpacked/piggy_trailer: data
arch/arm/boot/zImage_unpacked/sizes: ASCII text
gdb 无法加载 kernel.img
答案 0 :(得分:3)
make vmlinux
。我相信GDB可以读取它,但是自从我尝试以来,它已经很长时间了很多内核版本。