diff options
author | Krzysztof Parzyszek <kparzysz@codeaurora.org> | 2013-02-20 19:25:09 +0000 |
---|---|---|
committer | Krzysztof Parzyszek <kparzysz@codeaurora.org> | 2013-02-20 19:25:09 +0000 |
commit | 12ba711f35b43c1f9234bd644ee438fdb5fb05a4 (patch) | |
tree | a5e00b414ed2164843f9dfa62e99f5392fb2b992 /llvm/lib/Support/Unix/Memory.inc | |
parent | 54ecd9863fac6ec2a66296756af78f29f12f1667 (diff) | |
download | bcm5719-llvm-12ba711f35b43c1f9234bd644ee438fdb5fb05a4.tar.gz bcm5719-llvm-12ba711f35b43c1f9234bd644ee438fdb5fb05a4.zip |
Add comment in Memory.inc explaining r175646.
llvm-svn: 175650
Diffstat (limited to 'llvm/lib/Support/Unix/Memory.inc')
-rw-r--r-- | llvm/lib/Support/Unix/Memory.inc | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/llvm/lib/Support/Unix/Memory.inc b/llvm/lib/Support/Unix/Memory.inc index a66e3c7aeee..e00394ec6aa 100644 --- a/llvm/lib/Support/Unix/Memory.inc +++ b/llvm/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; |