instruction point value of dynamic linking and static linking

允我心安 提交于 2020-07-09 11:54:09

问题


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

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

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

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


回答1:


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

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.

See also this answer.



来源:https://stackoverflow.com/questions/62125651/instruction-point-value-of-dynamic-linking-and-static-linking

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!