objdump和解决本地函数调用的链接? [英] objdump and resolving linkage of local function calls?

查看:188
本文介绍了objdump和解决本地函数调用的链接?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果我在(linux amd64).o文件上运行objdump -d,则会显示函数调用,而没有完成链接时间解析.示例:

If I run objdump -d on a (linux amd64) .o file, function calls show up without the link time resolution done. Example:

  90:   66 89 44 24 1c          mov    %ax,0x1c(%rsp)
  95:   44 89 74 24 10          mov    %r14d,0x10(%rsp)
  9a:   e8 00 00 00 00          callq  9f <foo+0x9f>
  9f:   83 f8 ff                cmp    $0xffffffffffffffff,%eax
  a2:   74 5e                   je     102 <foo+0x102>

该函数内的一个分支正确显示,但callq只是链接器的存根(链接器可以使用四个字节的零来将适当的地址放入其中).

A branch within the function shows up properly, but the callq is just the stub put in for the linker (with four bytes of zeros available for the linker to put a proper address into).

是否有一种方法,无需实际链接,即可获得已解析函数名称的程序集列表?我不在乎最终将使用的地址,仅在乎函数的名称.该信息必须位于.o文件中,因为链接器必须使用它才能完成其工作.

Is there a way, without actually linking, to get an assembly listing that has the function names resolved? I don't care about the address that will eventually be used, just the name of the function. That info has got to be in the .o file, since the linker must consume it to do its job.

我问是因为有问题的代码进入的共享库大约为140Mb,并且花了很长的时间来运行objdump -d才能获得所有函数调用的asm转储解析为他们的真实姓名.

I ask because the shared lib that the code in question goes into is about 140Mb, and it takes a long time to run objdump -d on that to get the asm dump with all the function calls resolved to their actual names.

推荐答案

是否有一种方法,无需实际链接,即可获得已解析函数名称的程序集列表?

Is there a way, without actually linking, to get an assembly listing that has the function names resolved?

是:使用objdump -dr foo.o

这篇关于objdump和解决本地函数调用的链接?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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