Index: lib/asan/asan_mapping.h =================================================================== --- lib/asan/asan_mapping.h +++ lib/asan/asan_mapping.h @@ -183,6 +183,7 @@ # define SHADOW_OFFSET kMIPS64_ShadowOffset64 # elif SANITIZER_WINDOWS64 # define SHADOW_OFFSET __asan_shadow_memory_dynamic_address +# define ASAN_DYNAMIC_SHADOW_ADDRESS 1 # else # define SHADOW_OFFSET kDefaultShort64bitShadowOffset # endif Index: lib/asan/asan_rtl.cc =================================================================== --- lib/asan/asan_rtl.cc +++ lib/asan/asan_rtl.cc @@ -463,16 +463,17 @@ __asan_shadow_memory_dynamic_address = 0; uptr shadow_start = kLowShadowBeg; - if (shadow_start == 0) { - uptr granularity = GetMmapGranularity(); - uptr alignment = 8 * granularity; - uptr left_padding = granularity; - uptr space_size = kHighShadowEnd + left_padding; - - shadow_start = FindAvailableMemoryRange(space_size, alignment, granularity); - CHECK_NE((uptr)0, shadow_start); - CHECK(IsAligned(shadow_start, alignment)); - } +#if ASAN_DYNAMIC_SHADOW_ADDRESS + CHECK_EQ(0, shadow_start); + uptr granularity = GetMmapGranularity(); + uptr alignment = 8 * granularity; + uptr left_padding = granularity; + uptr space_size = kHighShadowEnd + left_padding; + + shadow_start = FindAvailableMemoryRange(space_size, alignment, granularity); + CHECK_NE((uptr)0, shadow_start); + CHECK(IsAligned(shadow_start, alignment)); +#endif __asan_shadow_memory_dynamic_address = shadow_start; if (kLowShadowBeg)