aboutsummaryrefslogtreecommitdiff
path: root/lib/Support/Unix
diff options
context:
space:
mode:
authorKrzysztof Parzyszek <kparzysz@codeaurora.org>2013-02-20 19:25:09 +0000
committerKrzysztof Parzyszek <kparzysz@codeaurora.org>2013-02-20 19:25:09 +0000
commit033ee0f111b572ad4f167676e3c4bb4b71fe2da8 (patch)
tree63a83c30d593ba6e2880ec4fa3d5fa717ba9daea /lib/Support/Unix
parent09adcf7dcacf991e7d5ddc2cb6e5f751f67fcc4a (diff)
Add comment in Memory.inc explaining r175646.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@175650 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Support/Unix')
-rw-r--r--lib/Support/Unix/Memory.inc7
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/Support/Unix/Memory.inc b/lib/Support/Unix/Memory.inc
index a66e3c7aee..e00394ec6a 100644
--- a/lib/Support/Unix/Memory.inc
+++ b/lib/Support/Unix/Memory.inc
@@ -52,6 +52,13 @@ int getPosixProtectionFlags(unsigned Flags) {
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;