llvm-project/compiler-rt/lib/xray
Elia Geretto b46c89892f [XRay][compiler-rt][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-06 10:38:27 -08:00
..
tests [CMake] Use find_library for ncurses 2020-08-31 20:06:21 -07:00
CMakeLists.txt [CMake] Avoid accidental C++ standard library dependency in sanitizers 2020-10-31 02:37:38 -07:00
weak_symbols.txt
xray_AArch64.cpp [XRay] Change ARM/AArch64/powerpc64le to use version 2 sled (PC-relative address) 2020-04-24 08:35:43 -07:00
xray_allocator.h
xray_always_instrument.txt
xray_arm.cpp [XRay] Change ARM/AArch64/powerpc64le to use version 2 sled (PC-relative address) 2020-04-24 08:35:43 -07:00
xray_basic_flags.cpp compiler-rt: Rename .cc file in lib/xray to .cpp 2019-08-01 12:30:58 +00:00
xray_basic_flags.h
xray_basic_flags.inc
xray_basic_logging.cpp [Sanitizers] Remove OpenBSD support (new attempt) 2020-10-20 11:16:09 +01:00
xray_basic_logging.h
xray_buffer_queue.cpp compiler-rt: Rename .cc file in lib/xray to .cpp 2019-08-01 12:30:58 +00:00
xray_buffer_queue.h
xray_defs.h
xray_fdr_controller.h
xray_fdr_flags.cpp compiler-rt: Rename .cc file in lib/xray to .cpp 2019-08-01 12:30:58 +00:00
xray_fdr_flags.h
xray_fdr_flags.inc
xray_fdr_log_records.h
xray_fdr_log_writer.h
xray_fdr_logging.cpp Fix xray fdr mode to allow multiple flushes 2021-02-10 12:57:24 +11:00
xray_fdr_logging.h
xray_flags.cpp compiler-rt: Rename .cc file in lib/xray to .cpp 2019-08-01 12:30:58 +00:00
xray_flags.h
xray_flags.inc
xray_function_call_trie.h
xray_init.cpp [xray] Option to omit the function index 2020-06-17 13:49:01 -04:00
xray_interface.cpp [xray] Option to omit the function index 2020-06-17 13:49:01 -04:00
xray_interface_internal.h [XRay] Change Sled.Function to PC-relative for sled version 2 and make llvm-xray support sled version 2 addresses 2020-04-24 14:41:56 -07:00
xray_log_interface.cpp compiler-rt: Rename .cc file in lib/xray to .cpp 2019-08-01 12:30:58 +00:00
xray_mips.cpp [XRay] Change mips to use version 2 sled (PC-relative address) 2020-09-20 17:59:57 -07:00
xray_mips64.cpp [XRay] Change mips to use version 2 sled (PC-relative address) 2020-09-20 17:59:57 -07:00
xray_never_instrument.txt
xray_powerpc64.cpp [XRay] Change ARM/AArch64/powerpc64le to use version 2 sled (PC-relative address) 2020-04-24 08:35:43 -07:00
xray_powerpc64.inc
xray_profile_collector.cpp compiler-rt: Rename .cc file in lib/xray to .cpp 2019-08-01 12:30:58 +00:00
xray_profile_collector.h
xray_profiling.cpp compiler-rt: Rename .cc file in lib/xray to .cpp 2019-08-01 12:30:58 +00:00
xray_profiling_flags.cpp compiler-rt: Rename .cc file in lib/xray to .cpp 2019-08-01 12:30:58 +00:00
xray_profiling_flags.h
xray_profiling_flags.inc
xray_recursion_guard.h
xray_segmented_array.h
xray_trampoline_AArch64.S [xray] Preserve x8 in trampoline on AArch64 2020-04-27 14:57:26 -04:00
xray_trampoline_arm.S [xray] Avoid text relocations in trampolines for ARM/AArch64 2020-04-21 23:21:02 -04:00
xray_trampoline_mips.S
xray_trampoline_mips64.S
xray_trampoline_powerpc64.cpp compiler-rt: Rename .cc file in lib/xray to .cpp 2019-08-01 12:30:58 +00:00
xray_trampoline_powerpc64_asm.S
xray_trampoline_x86_64.S [XRay][compiler-rt][x86_64] Fix CFI directives in assembly trampolines 2021-03-06 10:38:27 -08:00
xray_tsc.h
xray_utils.cpp [XRay] Record the XRay data size as a property of the VMO 2020-03-19 19:01:05 -07:00
xray_utils.h
xray_x86_64.cpp [Sanitizers] Remove OpenBSD support (new attempt) 2020-10-20 11:16:09 +01:00
xray_x86_64.inc [XRay] Remove unnecessary <x86intrin.h> include 2020-12-14 12:36:35 +02:00