gpt4 book ai didi

gdb - 如何从 uImage (arm) 中提取内核符号?

转载 作者:行者123 更新时间:2023-12-01 14:21:14 29 4
gpt4 key购买 nike

我想从 u-boot 镜像中提取内核符号

最终目标是使用 gdb 调试系统调用


内核使用 CONFIG_DEBUG_INFO=y 编译,gcc 使用 -g 选项(我检查过)

制作 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

kernel.img 不能被 gdb

加载

最佳答案

制作 vmlinux。我相信 GDB 可以读取它,但自从我尝试以来已经过了很长时间并且有很多内核版本。

编辑:哦,我应该说,vmlinux 和 uImage 应该是相同的,但包装不同。如果不是这种情况,那么这将不起作用。

关于gdb - 如何从 uImage (arm) 中提取内核符号?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9827406/

29 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com