llvm-project/compiler-rt/lib
Elia Geretto 9ee61cf3f6 [XRay][x86_64] Fix CFI directives in assembly trampolines
This patch modifies the x86_64 XRay trampolines to fix the CFI information
generated by the assembler. One of the main issues in correcting the CFI
directives is the `ALIGNED_CALL_RAX` macro, which makes the CFA dependent on
the alignment of the stack. However, this macro is not really necessary because
some additional assumptions can be made on the alignment of the stack when the
trampolines are called. The code has been written as if the stack is guaranteed
to be 8-bytes aligned; however, it is instead guaranteed to be misaligned by 8
bytes with respect to a 16-bytes alignment. For this reason, always moving the
stack pointer by 8 bytes is sufficient to restore the appropriate alignment.

Trampolines that are called from within a function as a result of the builtins
`__xray_typedevent` and `__xray_customevent` are necessarely called with the
stack properly aligned so, in this case too, `ALIGNED_CALL_RAX` can be
eliminated.

Fixes: https://bugs.llvm.org/show_bug.cgi?id=49060

Reviewed By: MaskRay

Differential Revision: https://reviews.llvm.org/D96785
2021-03-03 10:01:28 -08:00
..
BlocksRuntime
asan [Sanitizer][NFC] Fix typo 2021-03-01 23:47:03 +00:00
builtins Reland "[builtins] Define fmax and scalbn inline" 2021-02-26 16:20:14 -08:00
cfi [sanitizers] Remove unneeded MaybeCall*DefaultOptions() and nullptr checks 2020-09-08 10:12:05 -07:00
crt [RISCV][crt] support building without init_array 2020-12-01 17:17:50 +03:00
dfsan [dfsan] Propagate origins for callsites 2021-02-26 19:12:03 +00:00
fuzzer Bugfix for collecting features from very small DSOs. 2021-02-17 13:04:49 -08:00
gwp_asan [GWP-ASan] Change sys/cdefs.h to features.h 2021-02-17 20:03:16 -08:00
hwasan [NFC] Remove tab from the source 2021-02-26 19:40:24 -08:00
interception [sanitizer] Define SANITIZER_GLIBC to refine SANITIZER_LINUX feature detection and support musl 2021-01-06 10:55:40 -08:00
lsan [LSan][RISCV] Enable LSan for RISCV64 2021-01-31 21:53:25 +00:00
memprof [asan][memprof] Declare _DYNAMIC and fix -Wparentheses 2020-12-27 20:28:59 -08:00
msan [msan] Use non-transparent-huge-page at SetShadow 2021-02-27 00:28:57 +00:00
profile [profile] Delete zero-size dummy sections 2021-02-28 21:07:30 -08:00
safestack compiler-rt: Rename .cc file in lib/{interception/tests,safestack} to .cpp 2019-08-01 13:56:52 +00:00
sanitizer_common [darwin] switch blocking mutex from osspinlock to os_unfair_lock 2021-03-01 10:52:47 -08:00
scudo [scudo][test] Disable -Wfree-nonheap-object 2021-02-26 11:14:50 -08:00
stats compiler-rt: Rename .cc file in lib/{dfsan,stats,ubsan_minimal} to .cpp 2019-08-01 12:41:23 +00:00
tsan [sanitizers] Pass CMAKE_C_FLAGS into TSan buildgo script 2021-02-22 18:49:02 +01:00
ubsan Fix UBSAN in __ubsan::Value::getSIntValue 2021-02-23 11:10:21 +01:00
ubsan_minimal [compiler-rt] Suppress -Wunused-result due to ::write when _FORTIFY_SOURCE>0 in glibc 2020-10-12 09:57:12 -07:00
xray [XRay][x86_64] Fix CFI directives in assembly trampolines 2021-03-03 10:01:28 -08:00
CMakeLists.txt [MemProf] Decouple memprof build from COMPILER_RT_BUILD_SANITIZERS 2020-10-26 13:52:50 -07:00