summaryrefslogtreecommitdiff
path: root/lib/asan/asan_rtl.cc
diff options
context:
space:
mode:
authorEtienne Bergeron <etienneb@google.com>2016-06-06 18:09:54 +0000
committerEtienne Bergeron <etienneb@google.com>2016-06-06 18:09:54 +0000
commite2e2f47b377ba5c5151bddc528f12fc9c2812bdf (patch)
tree5f2795cd15900b639358cbb2d42a4a624c623476 /lib/asan/asan_rtl.cc
parent377ec60591cbfcef6ecf022b76b06e8a8ab67990 (diff)
This patch attempts to primitive support for Win64 asan
Some known issues are: When "head" include instructions that involve branching, the "cut and paste" approach may break down in a way that function interception still work but calling back the original function does not work. The jmp [rip -8] saves some bytes in the "head" but finding the safe zone of 0xCC is not implemented yet. So it may stomp on preceding codes. The shadow offset is not working yet on Win64. More complexity maybe involved since there are some differences regarding virtual address space between Window 8 and Windows 8.1/10. Patch by: Wang Wei Differential Revision: http://reviews.llvm.org/D20884 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@271915 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/asan/asan_rtl.cc')
-rw-r--r--lib/asan/asan_rtl.cc6
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/asan/asan_rtl.cc b/lib/asan/asan_rtl.cc
index b289b55c0..b31c99050 100644
--- a/lib/asan/asan_rtl.cc
+++ b/lib/asan/asan_rtl.cc
@@ -463,6 +463,12 @@ static void AsanInitInternal() {
kMidMemBeg = kLowMemEnd < 0x3000000000ULL ? 0x3000000000ULL : 0;
kMidMemEnd = kLowMemEnd < 0x3000000000ULL ? 0x4fffffffffULL : 0;
}
+#elif SANITIZER_WINDOWS64
+ // Disable the "mid mem" shadow layout.
+ if (!full_shadow_is_available) {
+ kMidMemBeg = 0;
+ kMidMemEnd = 0;
+ }
#endif
if (Verbosity()) PrintAddressSpaceLayout();