How is runtime-generated machine-code (such as the output of a JIT), actually executed by the CPU if the CPU/OS has an Execution Disable bit?
As far as I know, many modern processors and Operating Systems include support for an NX bit, (including Intel and ARM), which prevents machine code that is stored at any address other than the code section of a compiled binary from being executed. Clearly, this is a nice security advantage, because it prevents shell-code injection attacks.
But how do JIT engines, like LLVM, which dynamically generate machine-code, get around this?