[compiler-rt] 966d564 - asan_static x86-64: Support 64-bit ASAN_SHADOW_OFFSET_CONST redux (#76185)
via llvm-commits
llvm-commits at lists.llvm.org
Sun Dec 24 20:37:40 PST 2023
Author: Dan McGregor
Date: 2023-12-24T20:37:35-08:00
New Revision: 966d564e43e650b9c34f9c67829d3947f52add91
URL: https://github.com/llvm/llvm-project/commit/966d564e43e650b9c34f9c67829d3947f52add91
DIFF: https://github.com/llvm/llvm-project/commit/966d564e43e650b9c34f9c67829d3947f52add91.diff
LOG: asan_static x86-64: Support 64-bit ASAN_SHADOW_OFFSET_CONST redux (#76185)
Similar to b9935bb02a50, but also apply a similar change to
ACCESS_CHECK_ADD.
If ASAN_SHADOW_OFFSET_CONST cannot be encoded as a displacement, switch
to `movabsq` and the register offset variant of cmp.
Added:
Modified:
compiler-rt/lib/asan/asan_rtl_x86_64.S
Removed:
################################################################################
diff --git a/compiler-rt/lib/asan/asan_rtl_x86_64.S b/compiler-rt/lib/asan/asan_rtl_x86_64.S
index e44587ac4331c7..9c5289856d8ae6 100644
--- a/compiler-rt/lib/asan/asan_rtl_x86_64.S
+++ b/compiler-rt/lib/asan/asan_rtl_x86_64.S
@@ -89,7 +89,12 @@ ENDF
#define ASAN_MEMORY_ACCESS_CHECK_ADD(reg, op, s, c) \
mov %##reg,%r10 ;\
shr $0x3,%r10 ;\
+ .if ASAN_SHADOW_OFFSET_CONST < 0x80000000 ;\
##c $0x0,ASAN_SHADOW_OFFSET_CONST(%r10) ;\
+ .else ;\
+ movabsq $ASAN_SHADOW_OFFSET_CONST,%r11 ;\
+ ##c $0x0,(%r10,%r11) ;\
+ .endif ;\
jne FLABEL(reg, op, s, add) ;\
retq ;\
More information about the llvm-commits
mailing list