forked from chromium/chromium
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Syscall: Fix Syscall::Call's X86-64 implementation for CFI unwinding
The LEA instruction within the inline assembly statement was throwing off glibc's backtrace() function, because it lost track of where the stack was. The easy fix for this is to convert SyscallAsm() to simply use the standard C calling convention on X86-64, and make it into a normal C function call so the compiler can ensure CFI information is correct for us. While here, there's no need to use the "call/pop/addq" trick to compute a PC-relative address because we have %rip-based addressing. So simply use "lea 2f(%rip), %rax" to compute the return address (and avoid branch mispredictions from desync'ing the call stack). BUG=424973 Review URL: https://codereview.chromium.org/661393004 Cr-Commit-Position: refs/heads/master@{#300374}
- Loading branch information
Showing
2 changed files
with
22 additions
and
40 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