vmlinux 反汇编_看vmlinux的符号信息

本文档介绍了如何使用objdump和readelf工具来查看和解析vmlinux的调试符号信息,特别是针对MIPS架构。内容包括不同选项的用法,如-D、-d、-S、-t等,以及如何查看行号、文件路径、符号表、段头和动态符号表等信息。此外,还提到了readelf和ld命令的用法,如显示kernel入口点和连接地图。
摘要由CSDN通过智能技术生成

用xx-objdump来查看binary的信息,尤其是调试信息

这几天,一直在研究mips仿真器为什么不能源码级别调试汇编代码,

一直再看 vmlinux的debug symbol的相关的东西 ,特此做一些备忘录。

尤其是 一些objdump的选项。

又深入研究了下ELF的东西。

ELF太重要了。

以下都是vmlinux和head.o为例的。

1,看起来,每个版本的objdump的支持都不一样的。

至少输出的选项也是不一样的。

当然最有用就是:

-D :反汇编所有的sections

-d :反汇编executable sections

-S :混合显示汇编代码和原始代码,太有用了******

-t :显示调试信息,尤其是可以显示出行号和文件名和路径(配合-l)

-l, --line-numbersInclude line numbers and filenames in output

下面就是endian的选择了

-EB --endian=bigAssume big endian format when disassembling

-EL --endian=littleAssume little endian format when disassembling

下面输出的elf32-tradbigmips是支持的平台

[bob@localhost linux-2.6.20.9]$ /home/bob/gcc-3.2.2-uClibc-0.9.19/mips-linux/bin/mips-linux-objdump

-b

/home/bob/gcc-3.2.2-uClibc-0.9.19/mips-linux/bin/mips-linux-objdump: option requires an argument --

b

Usage: /home/bob/gcc-3.2.2-uClibc-0.9.19/mips-linux/bin/mips-linux-objdump

Display information from object .

At least one of the following switches must be given:

-a, --archive-headersDisplay archive header information

-f, --file-headersDisplay the contents of the overall file header

-p, --private-headersDisplay object format specific file header contents

-h, --[section-]headersDisplay the contents of the section headers

-x, --all-headersDisplay the contents of all headers

-d, --disassembleDisplay assembler contents of executable sections

-D, --disassemble-allDisplay assembler contents of all sections

-S, --sourceIntermix source code with disassembly

-s, --full-contentsDisplay the full contents of all sections requested

-g, --debuggingDisplay debug information in object file

-G, --stabsDisplay (in raw form) any STABS info in the file

-t, --symsDisplay the contents of the symbol table(s)

-T, --dynamic-symsDisplay the contents of the dynamic symbol table

-r, --relocDisplay the relocation entries in the file

-R, --dynamic-relocDisplay the dynamic relocation entries in the file

-v, --versionDisplay this program's version number

-i, --infoList object formats and architectures supported

-H, --helpDisplay this information

The following switches are optional:

-b, --target=BFDNAMESpecify the target object format as BFDNAME

-m, --architecture=MACHINESpecify the target architecture as MACHINE

-j, --section=NAMEOnly display information for section NAME

-M, --disassembler-options=OPT Pass text OPT on to the disassembler<

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值