From 3a83b8b2d29e020b8ccde42d0949db45c7eb356a Mon Sep 17 00:00:00 2001 From: Lang Hames Date: Tue, 30 Mar 2021 17:53:59 -0700 Subject: [PATCH] [JITLink] Add a setProtectionFlags method to jitlink::Section. This allows clients to modify the memory protection settings on sections via jitlink passes. This can be used to, for example, override the default settings on text pages and make them Read/Write/Executable under the JIT. --- llvm/include/llvm/ExecutionEngine/JITLink/JITLink.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/llvm/include/llvm/ExecutionEngine/JITLink/JITLink.h b/llvm/include/llvm/ExecutionEngine/JITLink/JITLink.h index c2335b0..c145c99 100644 --- a/llvm/include/llvm/ExecutionEngine/JITLink/JITLink.h +++ b/llvm/include/llvm/ExecutionEngine/JITLink/JITLink.h @@ -596,6 +596,11 @@ public: /// Returns the protection flags for this section. sys::Memory::ProtectionFlags getProtectionFlags() const { return Prot; } + /// Set the protection flags for this section. + void setProtectionFlags(sys::Memory::ProtectionFlags Prot) { + this->Prot = Prot; + } + /// Returns the ordinal for this section. SectionOrdinal getOrdinal() const { return SecOrdinal; } -- 2.7.4