[compiler-rt] r194370 - [msan] Sanity check for non-PIE.
Evgeniy Stepanov
eugeni.stepanov at gmail.com
Mon Nov 11 01:27:21 PST 2013
Author: eugenis
Date: Mon Nov 11 03:27:20 2013
New Revision: 194370
URL: http://llvm.org/viewvc/llvm-project?rev=194370&view=rev
Log:
[msan] Sanity check for non-PIE.
Modified:
compiler-rt/trunk/lib/msan/msan_linux.cc
Modified: compiler-rt/trunk/lib/msan/msan_linux.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/msan/msan_linux.cc?rev=194370&r1=194369&r2=194370&view=diff
==============================================================================
--- compiler-rt/trunk/lib/msan/msan_linux.cc (original)
+++ compiler-rt/trunk/lib/msan/msan_linux.cc Mon Nov 11 03:27:20 2013
@@ -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);
More information about the llvm-commits
mailing list