[msan] Sanity check for non-PIE.

llvm-svn: 194370
This commit is contained in:
Evgeniy Stepanov 2013-11-11 09:27:20 +00:00
parent 987f59b5c3
commit bfdb9b2ec6
1 changed files with 6 additions and 0 deletions

View File

@ -45,6 +45,12 @@ static const uptr kOriginsBeg = kBad2Beg;
static const uptr kOriginsEnd = kBad2End;
bool InitShadow(bool prot1, bool prot2, bool map_shadow, bool init_origins) {
if ((uptr) & InitShadow < kMemBeg) {
Printf("FATAL: Code below application range: %p < %p. Non-PIE build?\n",
&InitShadow, (void *)kMemBeg);
return false;
}
if (common_flags()->verbosity) {
Printf("__msan_init %p\n", &__msan_init);
Printf("Memory : %p %p\n", kMemBeg, kMemEnd);