[PATCH] D35558: Use sys::Memory::AllocateRWX for JIT code

Reid Kleckner via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jul 19 17:25:25 PDT 2017


rnk added a comment.

In https://reviews.llvm.org/D35558#815451, @joerg wrote:

> They are not allocated RWX, they are allocated RW with the option for later X. I.e. the kernel enforces W^X, but you can request
>  additional protections for later use. Without that, mprotect with X would be rejected later. There are patching for Linux for similar effect, but I don't think
>  they ever got merged. libffi is a victim of that on Linux.


That makes sense, but it seems like the right thing then is for LLVM to change its APIs to allocate RW pages everywhere and then flip them between RW and RX. We should remove this error-prone AllocateRWX API.


Repository:
  rL LLVM

https://reviews.llvm.org/D35558





More information about the llvm-commits mailing list