What instructions 'instCount' Pin tool counts?

不想你离开。 提交于 2019-12-02 13:28:44

问题


I run pintool 'instCount' on basic C program with empty body within the main function.

int main() {

}

When I run the instCount on this program executable , it shows around 86000 instructions. Even the program is very small why so many instructions are genrated..??Any idea.??

Thank you


回答1:


What's missing is that behind the scenes, a lot of work is done to get you up to the point where the main() function is executed. There is a lot of work that the runtime needs to perform in order to provide the environment as you expect to get it. For example:

  • Libraries must be loaded and initialized.
  • Internal data structures (e.g. the dynamic memory allocator) need to be allocated and initialized.
  • There are various factors in the environment that may change the way the runtime should be have. This needs to be checked and also acted upon.

The things I listed are just a very partial list of what happens during startup. Similar things occur during shutdown which also add to the instruction count.



来源:https://stackoverflow.com/questions/34636662/what-instructions-instcount-pin-tool-counts

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