[llvm] r175650 - Add comment in Memory.inc explaining r175646.

Krzysztof Parzyszek kparzysz at codeaurora.org
Wed Feb 20 11:25:09 PST 2013


Author: kparzysz
Date: Wed Feb 20 13:25:09 2013
New Revision: 175650

URL: http://llvm.org/viewvc/llvm-project?rev=175650&view=rev
Log:
Add comment in Memory.inc explaining r175646.

Modified:
    llvm/trunk/lib/Support/Unix/Memory.inc

Modified: llvm/trunk/lib/Support/Unix/Memory.inc
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Support/Unix/Memory.inc?rev=175650&r1=175649&r2=175650&view=diff
==============================================================================
--- llvm/trunk/lib/Support/Unix/Memory.inc (original)
+++ llvm/trunk/lib/Support/Unix/Memory.inc Wed Feb 20 13:25:09 2013
@@ -52,6 +52,13 @@ int getPosixProtectionFlags(unsigned Fla
     return PROT_READ | PROT_WRITE | PROT_EXEC;
   case llvm::sys::Memory::MF_EXEC:
 #if defined(__FreeBSD__)
+    // On PowerPC, having an executable page that has no read permission
+    // can have unintended consequences.  The function InvalidateInstruction-
+    // Cache uses instructions dcbf and icbi, both of which are treated by
+    // the processor as loads.  If the page has no read permissions,
+    // executing these instructions will result in a segmentation fault.
+    // Somehow, this problem is not present on Linux, but it does happen
+    // on FreeBSD.
     return PROT_READ | PROT_EXEC;
 #else
     return PROT_EXEC;





More information about the llvm-commits mailing list