GDB与objdump的反汇编手臂职能部门名称解析 [英] gdb vs. objdump arm disassembler function branch name resolving

查看:442
本文介绍了GDB与objdump的反汇编手臂职能部门名称解析的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一点奇怪的问题。如果我使用objdump的-d拆卸的ARM二进制就可以解决的功能(系统库)的分支指令例如名称:

I have a bit of strange question. If I use objdump -d for disassembling an ARM binary it can resolve the function (system library) names of branch instructions e.g.:

8404:   e581e000    str lr, [r1]
8408:   e59f0028    ldr r0, [pc, #40]   ; 8438 <address_of_message1>
840c:   ebffffc1    bl  8318 <printf@plt>
8410:   e59f0028    ldr r0, [pc, #40]   ; 8440 <address_of_scan_pattern>
8414:   e59f1028    ldr r1, [pc, #40]   ; 8444 <address_of_read>
8418:   ebffffc4    bl  8330 <scanf@plt>
841c:   e59f0018    ldr r0, [pc, #24]   ; 843c <address_of_message2>

所以我看到BL 8318会调用printf。
当我使用GDB和disas命令我没有得到函数名(同一code样品)拆卸,请参见:

So I see bl 8318 will call printf. When I use gdb and the disas command I get the disassembly without the function name (same code sample), see:

   0x00008408 <+8>:     ldr r0, [pc, #40]   ; 0x8438 <address_of_message1>
   0x0000840c <+12>:    bl  0x8318
   0x00008410 <+16>:    ldr r0, [pc, #40]   ; 0x8440 <address_of_scan_pattern>
   0x00008414 <+20>:    ldr r1, [pc, #40]   ; 0x8444 <address_of_read>
   0x00008418 <+24>:    bl  0x8330

在gdb的我只看到分支0x8330。

In gdb I see only the branch to 0x8330.

是否有可能使用gdb也解析函数的名字吗?

Is it possible to resolve the function name also with gdb ?

任何人都可以向我解释为什么objdump的可以解决系统的载体作用调用的名称和GDB不?

Can anybody explain to me why objdump can resolve the name of system functin calls and gdb not ?

推荐答案

GDB和GNU objdump的使用相同的库(BFD)来读取和跨preT库,但它在静态编译。
这意味着,一个旧版本的gdb可以显示小于一个较新的objdump的。

gdb and GNU objdump use the same library (bfd) to read and interpret library, but it's statically compiled in. That means, that an old version of gdb could show less then a newer objdump.

我测试过最近objdump的和一个Hello World在i386最近GDB无一不显示出相同的信息。

I've tested a recent objdump and a recent gdb on i386 on a hello world and both show the same information.

请确认您使用的是最近的GDB。

Please check that you're using a recent gdb.

注:printf函数@ PLT是不printf的本身,而是指向动态加载功能,将从共享库时发生跳加载真正的printf

Note: the function printf@plt is not the printf itself, but a function pointing to the dynamic loader, that will load the real printf from a shared library when jump occurs

这篇关于GDB与objdump的反汇编手臂职能部门名称解析的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆