I've implemented a tool with return address stack to pair each return instruction to a proceeding call instruction.
And I found that there are returns not paired with a proceeding call.
Some interesting statistics from Delta collection of Google workload traces:
- Number of call instructions: 36503053
- Number of return instructions: 36511116
The amount of returns is 0.02% more than the amount of calls.
Though the difference is small, I am still wondering why there are such unpaired return instructions. Does the benchmark program manipulate the stack segment to force branching to some specific service?