forked from llvm/llvm-project
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Get ykllvm to provide enough info to identify a zero-length call.
PT has this clause where returns are not compressed if the call is both direct and to the address immediately after the call. Section 33.4.2.2: > For near CALLs, push the Next IP onto the stack... Note that this > excludes zero-length CALLs, which are direct near CALLs with > displacement zero (to the next IP). These CALLs typically don’t have > matching RETs. For example, this kind of thing is never compressed: ``` 0x1234: call 0x1242 0x1242: pop rax ``` On x86_64 the instruction pointer register isn't addressable, so people sometimes use this trick to get its value. This change makes the compiler emit enough call information for the runtime to decide whether a call was "zero-length" (namely the return address of the call). It's not clear to me if this has ever bitten us, but it could be one of the causes of the rare PT decoding crashes that occasionally crop up.
- Loading branch information
Showing
2 changed files
with
34 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters