//===- SectionMemoryManager.h - Memory manager for MCJIT/RtDyld -*- C++ -*-===// // // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. // See https://llvm.org/LICENSE.txt for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// // // This file contains the declaration of a section-based memory manager used by // the MCJIT execution engine and RuntimeDyld. // //===----------------------------------------------------------------------===// #ifndef LLVM_EXECUTIONENGINE_SECTIONMEMORYMANAGER_H #define LLVM_EXECUTIONENGINE_SECTIONMEMORYMANAGER_H #include "llvm/ADT/SmallVector.h" #include "llvm/ExecutionEngine/RTDyldMemoryManager.h" #include "llvm/Support/Memory.h" #include <cstdint> #include <string> #include <system_error> namespace llvm { /// This is a simple memory manager which implements the methods called by /// the RuntimeDyld class to allocate memory for section-based loading of /// objects, usually those generated by the MCJIT execution engine. /// /// This memory manager allocates all section memory as read-write. The /// RuntimeDyld will copy JITed section memory into these allocated blocks /// and perform any necessary linking and relocations. /// /// Any client using this memory manager MUST ensure that section-specific /// page permissions have been applied before attempting to execute functions /// in the JITed object. Permissions can be applied either by calling /// MCJIT::finalizeObject or by calling SectionMemoryManager::finalizeMemory /// directly. Clients of MCJIT should call MCJIT::finalizeObject. class SectionMemoryManager : public RTDyldMemoryManager { … }; } // end namespace llvm #endif // LLVM_EXECUTIONENGINE_SECTIONMEMORYMANAGER_H