[PATCH] D52900: [PowerPC]Disable randomized address space on Linux ppc64le

Lei Huang via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Nov 2 12:02:54 PDT 2018


This revision was automatically updated to reflect the committed changes.
Closed by commit rL346030: [PowerPC]Disable randomized address space on Linux ppc64le (authored by lei, committed by ).
Herald added a subscriber: delcypher.

Changed prior to commit:
  https://reviews.llvm.org/D52900?vs=168850&id=172411#toc

Repository:
  rL LLVM

https://reviews.llvm.org/D52900

Files:
  compiler-rt/trunk/lib/sanitizer_common/sanitizer_linux.cc


Index: compiler-rt/trunk/lib/sanitizer_common/sanitizer_linux.cc
===================================================================
--- compiler-rt/trunk/lib/sanitizer_common/sanitizer_linux.cc
+++ compiler-rt/trunk/lib/sanitizer_common/sanitizer_linux.cc
@@ -2010,6 +2010,17 @@
     Printf("This sanitizer is not compatible with enabled ASLR\n");
     Die();
   }
+#elif SANITIZER_PPC64V2
+  // Disable ASLR for Linux PPC64LE.
+  int old_personality = personality(0xffffffff);
+  if (old_personality != -1 && (old_personality & ADDR_NO_RANDOMIZE) == 0) {
+    VReport(1, "WARNING: Program is being run with address space layout "
+               "randomization (ASLR) enabled which prevents the thread and "
+               "memory sanitizers from working on powerpc64le.\n"
+               "ASLR will be disabled and the program re-executed.\n");
+    CHECK_NE(personality(old_personality | ADDR_NO_RANDOMIZE), -1);
+    ReExec();
+  }
 #else
   // Do nothing
 #endif


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D52900.172411.patch
Type: text/x-patch
Size: 971 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20181102/94ee50c9/attachment.bin>


More information about the llvm-commits mailing list