问题
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