动态链接和静态链接的指令点值 [英] instruction point value of dynamic linking and static linking

查看:130
本文介绍了动态链接和静态链接的指令点值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

通过使用Intel的引脚,我打印出了具有动态链接和静态链接的程序的指令指针(ip)值.

By using Intel's pin, I printed out the instruction pointer (ip) values for a program with dynamic linking and static linking.

而且我发现,即使它们是同一程序,它们的ip值也大不相同.

And I've found that their ip values are quite different, even though they are the same program.

具有静态链接的程序的第一个ip值显示为0x400f50.

A program with static linking shows 0x400f50 for its very first ip value.

但是具有动态链接的程序的第一个ip值显示为0x7f94f0762090

but a program with dynamic linking shows 0x7f94f0762090 for its first ip value

我不确定他们为什么会有这么大的差距.

I am not sure why they have that quite a large gap.

如果有人可以帮助我找出原因,我们将不胜感激

It would be appreciated if anyone could help me find out the reason

推荐答案

我不确定他们为什么会有这么大的差距.

I am not sure why they have that quite a large gap.

因为动态链接程序无法以二进制形式开始执行:在控制权转移到主可执行文件中的_start之前,前几千条指令在动态链接器(ld-linux)中执行.

Because a dynamically linked program does not start executing in the binary: the first few thousands of instructions are executed in the dynamic linker (ld-linux), before control is transferred to _start in the main executable.

另请参见此答案.

这篇关于动态链接和静态链接的指令点值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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