LLVM  14.0.0git
RuntimeDyld.h
Go to the documentation of this file.
1 //===- RuntimeDyld.h - Run-time dynamic linker for MC-JIT -------*- C++ -*-===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
8 //
9 // Interface for the runtime dynamic linker facilities of the MC-JIT.
10 //
11 //===----------------------------------------------------------------------===//
12 
13 #ifndef LLVM_EXECUTIONENGINE_RUNTIMEDYLD_H
14 #define LLVM_EXECUTIONENGINE_RUNTIMEDYLD_H
15 
17 #include "llvm/ADT/STLExtras.h"
18 #include "llvm/ADT/StringRef.h"
21 #include "llvm/Object/ObjectFile.h"
22 #include "llvm/Support/Error.h"
23 #include <algorithm>
24 #include <cassert>
25 #include <cstddef>
26 #include <cstdint>
27 #include <map>
28 #include <memory>
29 #include <string>
30 #include <system_error>
31 
32 namespace llvm {
33 
34 namespace object {
35 
36 template <typename T> class OwningBinary;
37 
38 } // end namespace object
39 
40 /// Base class for errors originating in RuntimeDyld, e.g. missing relocation
41 /// support.
42 class RuntimeDyldError : public ErrorInfo<RuntimeDyldError> {
43 public:
44  static char ID;
45 
46  RuntimeDyldError(std::string ErrMsg) : ErrMsg(std::move(ErrMsg)) {}
47 
48  void log(raw_ostream &OS) const override;
49  const std::string &getErrorMessage() const { return ErrMsg; }
50  std::error_code convertToErrorCode() const override;
51 
52 private:
53  std::string ErrMsg;
54 };
55 
56 class RuntimeDyldImpl;
57 
58 class RuntimeDyld {
59 public:
60  // Change the address associated with a section when resolving relocations.
61  // Any relocations already associated with the symbol will be re-resolved.
62  void reassignSectionAddress(unsigned SectionID, uint64_t Addr);
63 
66  unsigned SectionID, uint32_t StubOffset)>;
67 
68  /// Information about the loaded object.
70  friend class RuntimeDyldImpl;
71 
72  public:
73  using ObjSectionToIDMap = std::map<object::SectionRef, unsigned>;
74 
77 
79  getObjectForDebug(const object::ObjectFile &Obj) const = 0;
80 
81  uint64_t
82  getSectionLoadAddress(const object::SectionRef &Sec) const override;
83 
84  protected:
85  virtual void anchor();
86 
89  };
90 
91  /// Memory Management.
92  class MemoryManager {
93  friend class RuntimeDyld;
94 
95  public:
96  MemoryManager() = default;
97  virtual ~MemoryManager() = default;
98 
99  /// Allocate a memory block of (at least) the given size suitable for
100  /// executable code. The SectionID is a unique identifier assigned by the
101  /// RuntimeDyld instance, and optionally recorded by the memory manager to
102  /// access a loaded section.
103  virtual uint8_t *allocateCodeSection(uintptr_t Size, unsigned Alignment,
104  unsigned SectionID,
105  StringRef SectionName) = 0;
106 
107  /// Allocate a memory block of (at least) the given size suitable for data.
108  /// The SectionID is a unique identifier assigned by the JIT engine, and
109  /// optionally recorded by the memory manager to access a loaded section.
110  virtual uint8_t *allocateDataSection(uintptr_t Size, unsigned Alignment,
111  unsigned SectionID,
113  bool IsReadOnly) = 0;
114 
115  /// An allocated TLS section
116  struct TLSSection {
117  /// The pointer to the initialization image
119  /// The TLS offset
121  };
122 
123  /// Allocate a memory block of (at least) the given size to be used for
124  /// thread-local storage (TLS).
125  virtual TLSSection allocateTLSSection(uintptr_t Size, unsigned Alignment,
126  unsigned SectionID,
128 
129  /// Inform the memory manager about the total amount of memory required to
130  /// allocate all sections to be loaded:
131  /// \p CodeSize - the total size of all code sections
132  /// \p DataSizeRO - the total size of all read-only data sections
133  /// \p DataSizeRW - the total size of all read-write data sections
134  ///
135  /// Note that by default the callback is disabled. To enable it
136  /// redefine the method needsToReserveAllocationSpace to return true.
137  virtual void reserveAllocationSpace(uintptr_t CodeSize, uint32_t CodeAlign,
138  uintptr_t RODataSize,
139  uint32_t RODataAlign,
140  uintptr_t RWDataSize,
141  uint32_t RWDataAlign) {}
142 
143  /// Override to return true to enable the reserveAllocationSpace callback.
144  virtual bool needsToReserveAllocationSpace() { return false; }
145 
146  /// Override to return false to tell LLVM no stub space will be needed.
147  /// This requires some guarantees depending on architecuture, but when
148  /// you know what you are doing it saves allocated space.
149  virtual bool allowStubAllocation() const { return true; }
150 
151  /// Register the EH frames with the runtime so that c++ exceptions work.
152  ///
153  /// \p Addr parameter provides the local address of the EH frame section
154  /// data, while \p LoadAddr provides the address of the data in the target
155  /// address space. If the section has not been remapped (which will usually
156  /// be the case for local execution) these two values will be the same.
157  virtual void registerEHFrames(uint8_t *Addr, uint64_t LoadAddr,
158  size_t Size) = 0;
159  virtual void deregisterEHFrames() = 0;
160 
161  /// This method is called when object loading is complete and section page
162  /// permissions can be applied. It is up to the memory manager implementation
163  /// to decide whether or not to act on this method. The memory manager will
164  /// typically allocate all sections as read-write and then apply specific
165  /// permissions when this method is called. Code sections cannot be executed
166  /// until this function has been called. In addition, any cache coherency
167  /// operations needed to reliably use the memory are also performed.
168  ///
169  /// Returns true if an error occurred, false otherwise.
170  virtual bool finalizeMemory(std::string *ErrMsg = nullptr) = 0;
171 
172  /// This method is called after an object has been loaded into memory but
173  /// before relocations are applied to the loaded sections.
174  ///
175  /// Memory managers which are preparing code for execution in an external
176  /// address space can use this call to remap the section addresses for the
177  /// newly loaded object.
178  ///
179  /// For clients that do not need access to an ExecutionEngine instance this
180  /// method should be preferred to its cousin
181  /// MCJITMemoryManager::notifyObjectLoaded as this method is compatible with
182  /// ORC JIT stacks.
183  virtual void notifyObjectLoaded(RuntimeDyld &RTDyld,
184  const object::ObjectFile &Obj) {}
185 
186  private:
187  virtual void anchor();
188 
189  bool FinalizationLocked = false;
190  };
191 
192  /// Construct a RuntimeDyld instance.
193  RuntimeDyld(MemoryManager &MemMgr, JITSymbolResolver &Resolver);
194  RuntimeDyld(const RuntimeDyld &) = delete;
195  RuntimeDyld &operator=(const RuntimeDyld &) = delete;
196  ~RuntimeDyld();
197 
198  /// Add the referenced object file to the list of objects to be loaded and
199  /// relocated.
200  std::unique_ptr<LoadedObjectInfo> loadObject(const object::ObjectFile &O);
201 
202  /// Get the address of our local copy of the symbol. This may or may not
203  /// be the address used for relocation (clients can copy the data around
204  /// and resolve relocatons based on where they put it).
205  void *getSymbolLocalAddress(StringRef Name) const;
206 
207  /// Get the section ID for the section containing the given symbol.
208  unsigned getSymbolSectionID(StringRef Name) const;
209 
210  /// Get the target address and flags for the named symbol.
211  /// This address is the one used for relocation.
213 
214  /// Returns a copy of the symbol table. This can be used by on-finalized
215  /// callbacks to extract the symbol table before throwing away the
216  /// RuntimeDyld instance. Because the map keys (StringRefs) are backed by
217  /// strings inside the RuntimeDyld instance, the map should be processed
218  /// before the RuntimeDyld instance is discarded.
219  std::map<StringRef, JITEvaluatedSymbol> getSymbolTable() const;
220 
221  /// Resolve the relocations for all symbols we currently know about.
222  void resolveRelocations();
223 
224  /// Map a section to its target address space value.
225  /// Map the address of a JIT section as returned from the memory manager
226  /// to the address in the target process as the running code will see it.
227  /// This is the address which will be used for relocation resolution.
228  void mapSectionAddress(const void *LocalAddress, uint64_t TargetAddress);
229 
230  /// Returns the section's working memory.
231  StringRef getSectionContent(unsigned SectionID) const;
232 
233  /// If the section was loaded, return the section's load address,
234  /// otherwise return None.
235  uint64_t getSectionLoadAddress(unsigned SectionID) const;
236 
237  /// Set the NotifyStubEmitted callback. This is used for debugging
238  /// purposes. A callback is made for each stub that is generated.
240  this->NotifyStubEmitted = std::move(NotifyStubEmitted);
241  }
242 
243  /// Register any EH frame sections that have been loaded but not previously
244  /// registered with the memory manager. Note, RuntimeDyld is responsible
245  /// for identifying the EH frame and calling the memory manager with the
246  /// EH frame section data. However, the memory manager itself will handle
247  /// the actual target-specific EH frame registration.
248  void registerEHFrames();
249 
250  void deregisterEHFrames();
251 
252  bool hasError();
254 
255  /// By default, only sections that are "required for execution" are passed to
256  /// the RTDyldMemoryManager, and other sections are discarded. Passing 'true'
257  /// to this method will cause RuntimeDyld to pass all sections to its
258  /// memory manager regardless of whether they are "required to execute" in the
259  /// usual sense. This is useful for inspecting metadata sections that may not
260  /// contain relocations, E.g. Debug info, stackmaps.
261  ///
262  /// Must be called before the first object file is loaded.
263  void setProcessAllSections(bool ProcessAllSections) {
264  assert(!Dyld && "setProcessAllSections must be called before loadObject.");
265  this->ProcessAllSections = ProcessAllSections;
266  }
267 
268  /// Perform all actions needed to make the code owned by this RuntimeDyld
269  /// instance executable:
270  ///
271  /// 1) Apply relocations.
272  /// 2) Register EH frames.
273  /// 3) Update memory permissions*.
274  ///
275  /// * Finalization is potentially recursive**, and the 3rd step will only be
276  /// applied by the outermost call to finalize. This allows different
277  /// RuntimeDyld instances to share a memory manager without the innermost
278  /// finalization locking the memory and causing relocation fixup errors in
279  /// outer instances.
280  ///
281  /// ** Recursive finalization occurs when one RuntimeDyld instances needs the
282  /// address of a symbol owned by some other instance in order to apply
283  /// relocations.
284  ///
286 
287 private:
288  friend void jitLinkForORC(
291  bool ProcessAllSections,
293  std::map<StringRef, JITEvaluatedSymbol>)>
294  OnLoaded,
296  std::unique_ptr<LoadedObjectInfo>, Error)>
297  OnEmitted);
298 
299  // RuntimeDyldImpl is the actual class. RuntimeDyld is just the public
300  // interface.
301  std::unique_ptr<RuntimeDyldImpl> Dyld;
302  MemoryManager &MemMgr;
304  bool ProcessAllSections;
305  NotifyStubEmittedFunction NotifyStubEmitted;
306 };
307 
308 // Asynchronous JIT link for ORC.
309 //
310 // Warning: This API is experimental and probably should not be used by anyone
311 // but ORC's RTDyldObjectLinkingLayer2. Internally it constructs a RuntimeDyld
312 // instance and uses continuation passing to perform the fix-up and finalize
313 // steps asynchronously.
314 void jitLinkForORC(
315  object::OwningBinary<object::ObjectFile> O,
316  RuntimeDyld::MemoryManager &MemMgr, JITSymbolResolver &Resolver,
317  bool ProcessAllSections,
318  unique_function<Error(const object::ObjectFile &Obj,
319  RuntimeDyld::LoadedObjectInfo &,
320  std::map<StringRef, JITEvaluatedSymbol>)>
321  OnLoaded,
322  unique_function<void(object::OwningBinary<object::ObjectFile>,
323  std::unique_ptr<RuntimeDyld::LoadedObjectInfo>, Error)>
324  OnEmitted);
325 
326 } // end namespace llvm
327 
328 #endif // LLVM_EXECUTIONENGINE_RUNTIMEDYLD_H
llvm::Check::Size
@ Size
Definition: FileCheck.h:73
llvm::RuntimeDyldError::RuntimeDyldError
RuntimeDyldError(std::string ErrMsg)
Definition: RuntimeDyld.h:46
llvm::RuntimeDyld::MemoryManager::~MemoryManager
virtual ~MemoryManager()=default
llvm::RuntimeDyld::LoadedObjectInfo::getSectionLoadAddress
uint64_t getSectionLoadAddress(const object::SectionRef &Sec) const override
Obtain the Load Address of a section by SectionRef.
Definition: RuntimeDyld.cpp:1275
llvm::RuntimeDyldError::log
void log(raw_ostream &OS) const override
Print an error message to an output stream.
Definition: RuntimeDyld.cpp:60
llvm
This is an optimization pass for GlobalISel generic memory operations.
Definition: AllocatorList.h:23
JITSymbol.h
FunctionExtras.h
llvm::RuntimeDyld::~RuntimeDyld
~RuntimeDyld()
Definition: RuntimeDyld.cpp:1310
intptr_t
llvm::unique_function
unique_function is a type-erasing functor similar to std::function.
Definition: FunctionExtras.h:56
llvm::RuntimeDyld::LoadedObjectInfo::getObjectForDebug
virtual object::OwningBinary< object::ObjectFile > getObjectForDebug(const object::ObjectFile &Obj) const =0
StringRef.h
llvm::RuntimeDyld::MemoryManager::deregisterEHFrames
virtual void deregisterEHFrames()=0
llvm::RuntimeDyld::MemoryManager::MemoryManager
MemoryManager()=default
llvm::RuntimeDyld::LoadedObjectInfo::anchor
virtual void anchor()
Definition: RuntimeDyld.cpp:72
llvm::RuntimeDyld::LoadedObjectInfo::ObjSecToIDMap
ObjSectionToIDMap ObjSecToIDMap
Definition: RuntimeDyld.h:88
Error.h
llvm::RuntimeDyldError
Base class for errors originating in RuntimeDyld, e.g.
Definition: RuntimeDyld.h:42
llvm::RuntimeDyld::resolveRelocations
void resolveRelocations()
Resolve the relocations for all symbols we currently know about.
Definition: RuntimeDyld.cpp:1399
llvm::RuntimeDyld::MemoryManager::TLSSection::Offset
intptr_t Offset
The TLS offset.
Definition: RuntimeDyld.h:120
llvm::RuntimeDyldImpl
Definition: RuntimeDyldImpl.h:238
STLExtras.h
llvm::JITEvaluatedSymbol
Represents a symbol that has been evaluated to an address already.
Definition: JITSymbol.h:229
llvm::RuntimeDyld::setProcessAllSections
void setProcessAllSections(bool ProcessAllSections)
By default, only sections that are "required for execution" are passed to the RTDyldMemoryManager,...
Definition: RuntimeDyld.h:263
llvm::RuntimeDyld::loadObject
std::unique_ptr< LoadedObjectInfo > loadObject(const object::ObjectFile &O)
Add the referenced object file to the list of objects to be loaded and relocated.
Definition: RuntimeDyld.cpp:1349
llvm::RuntimeDyld::LoadedObjectInfo::LoadedObjectInfo
LoadedObjectInfo(RuntimeDyldImpl &RTDyld, ObjSectionToIDMap ObjSecToIDMap)
Definition: RuntimeDyld.h:75
llvm::Resolver
Interface for looking up the initializer for a variable name, used by Init::resolveReferences.
Definition: Record.h:2013
llvm::RuntimeDyld::operator=
RuntimeDyld & operator=(const RuntimeDyld &)=delete
llvm::RuntimeDyld::reassignSectionAddress
void reassignSectionAddress(unsigned SectionID, uint64_t Addr)
Definition: RuntimeDyld.cpp:1401
llvm::RuntimeDyld::setNotifyStubEmitted
void setNotifyStubEmitted(NotifyStubEmittedFunction NotifyStubEmitted)
Set the NotifyStubEmitted callback.
Definition: RuntimeDyld.h:239
llvm::RuntimeDyld::getSymbolSectionID
unsigned getSymbolSectionID(StringRef Name) const
Get the section ID for the section containing the given symbol.
Definition: RuntimeDyld.cpp:1382
llvm::raw_ostream
This class implements an extremely fast bulk output stream that can only output to a stream.
Definition: raw_ostream.h:53
llvm::RuntimeDyld::MemoryManager::needsToReserveAllocationSpace
virtual bool needsToReserveAllocationSpace()
Override to return true to enable the reserveAllocationSpace callback.
Definition: RuntimeDyld.h:144
llvm::RuntimeDyld::MemoryManager::registerEHFrames
virtual void registerEHFrames(uint8_t *Addr, uint64_t LoadAddr, size_t Size)=0
Register the EH frames with the runtime so that c++ exceptions work.
llvm::RuntimeDyld::registerEHFrames
void registerEHFrames()
Register any EH frame sections that have been loaded but not previously registered with the memory ma...
Definition: RuntimeDyld.cpp:1435
llvm::RuntimeDyld::jitLinkForORC
friend void jitLinkForORC(object::OwningBinary< object::ObjectFile > O, RuntimeDyld::MemoryManager &MemMgr, JITSymbolResolver &Resolver, bool ProcessAllSections, unique_function< Error(const object::ObjectFile &Obj, LoadedObjectInfo &, std::map< StringRef, JITEvaluatedSymbol >)> OnLoaded, unique_function< void(object::OwningBinary< object::ObjectFile > O, std::unique_ptr< LoadedObjectInfo >, Error)> OnEmitted)
llvm::object::SectionRef
This is a value type class that represents a single section in the list of sections in the object fil...
Definition: ObjectFile.h:80
llvm::RuntimeDyld::MemoryManager::finalizeMemory
virtual bool finalizeMemory(std::string *ErrMsg=nullptr)=0
This method is called when object loading is complete and section page permissions can be applied.
llvm::RISCVFenceField::O
@ O
Definition: RISCVBaseInfo.h:206
object
bar al al movzbl eax ret Missed when stored in a memory object
Definition: README.txt:1411
llvm::RuntimeDyld::MemoryManager::TLSSection::InitializationImage
uint8_t * InitializationImage
The pointer to the initialization image.
Definition: RuntimeDyld.h:118
uint64_t
llvm::RuntimeDyld::LoadedObjectInfo::RTDyld
RuntimeDyldImpl & RTDyld
Definition: RuntimeDyld.h:87
Addr
uint64_t Addr
Definition: ELFObjHandler.cpp:80
llvm::RuntimeDyld::MemoryManager::reserveAllocationSpace
virtual void reserveAllocationSpace(uintptr_t CodeSize, uint32_t CodeAlign, uintptr_t RODataSize, uint32_t RODataAlign, uintptr_t RWDataSize, uint32_t RWDataAlign)
Inform the memory manager about the total amount of memory required to allocate all sections to be lo...
Definition: RuntimeDyld.h:137
llvm::RuntimeDyldError::getErrorMessage
const std::string & getErrorMessage() const
Definition: RuntimeDyld.h:49
move
compiles ldr LCPI1_0 ldr ldr mov lsr tst moveq r1 ldr LCPI1_1 and r0 bx lr It would be better to do something like to fold the shift into the conditional move
Definition: README.txt:546
llvm::jitLinkForORC
void jitLinkForORC(object::OwningBinary< object::ObjectFile > O, RuntimeDyld::MemoryManager &MemMgr, JITSymbolResolver &Resolver, bool ProcessAllSections, unique_function< Error(const object::ObjectFile &Obj, RuntimeDyld::LoadedObjectInfo &, std::map< StringRef, JITEvaluatedSymbol >)> OnLoaded, unique_function< void(object::OwningBinary< object::ObjectFile >, std::unique_ptr< RuntimeDyld::LoadedObjectInfo >, Error)> OnEmitted)
llvm::RuntimeDyld::getSectionContent
StringRef getSectionContent(unsigned SectionID) const
Returns the section's working memory.
Definition: RuntimeDyld.cpp:1425
llvm::RuntimeDyld::MemoryManager::notifyObjectLoaded
virtual void notifyObjectLoaded(RuntimeDyld &RTDyld, const object::ObjectFile &Obj)
This method is called after an object has been loaded into memory but before relocations are applied ...
Definition: RuntimeDyld.h:183
assert
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
llvm::RuntimeDyld::RuntimeDyld
RuntimeDyld(MemoryManager &MemMgr, JITSymbolResolver &Resolver)
Construct a RuntimeDyld instance.
Definition: RuntimeDyld.cpp:1297
llvm::move
OutputIt move(R &&Range, OutputIt Out)
Provide wrappers to std::move which take ranges instead of having to pass begin/end explicitly.
Definition: STLExtras.h:1639
ObjectFile.h
llvm::RuntimeDyld::NotifyStubEmittedFunction
std::function< void(StringRef FileName, StringRef SectionName, StringRef SymbolName, unsigned SectionID, uint32_t StubOffset)> NotifyStubEmittedFunction
Definition: RuntimeDyld.h:66
llvm::RuntimeDyld::getSectionLoadAddress
uint64_t getSectionLoadAddress(unsigned SectionID) const
If the section was loaded, return the section's load address, otherwise return None.
Definition: RuntimeDyld.cpp:1430
function
print Print MemDeps of function
Definition: MemDepPrinter.cpp:83
llvm::ErrorInfo
Base class for user error types.
Definition: Error.h:349
llvm::RuntimeDyld::finalizeWithMemoryManagerLocking
void finalizeWithMemoryManagerLocking()
Perform all actions needed to make the code owned by this RuntimeDyld instance executable:
Definition: RuntimeDyld.cpp:1414
llvm::StringRef
StringRef - Represent a constant reference to a string, i.e.
Definition: StringRef.h:57
llvm::object::ObjectFile
This class is the base class for all object file types.
Definition: ObjectFile.h:228
uint32_t
llvm::RuntimeDyld::MemoryManager::allocateCodeSection
virtual uint8_t * allocateCodeSection(uintptr_t Size, unsigned Alignment, unsigned SectionID, StringRef SectionName)=0
Allocate a memory block of (at least) the given size suitable for executable code.
llvm::RuntimeDyld::LoadedObjectInfo::ObjSectionToIDMap
std::map< object::SectionRef, unsigned > ObjSectionToIDMap
Definition: RuntimeDyld.h:73
llvm::JITSymbolResolver
Symbol resolution interface.
Definition: JITSymbol.h:371
llvm::AMDGPU::HSAMD::Kernel::Key::SymbolName
constexpr char SymbolName[]
Key for Kernel::Metadata::mSymbolName.
Definition: AMDGPUMetadata.h:381
DIContext.h
llvm::GraphProgram::Name
Name
Definition: GraphWriter.h:52
std
Definition: BitVector.h:838
llvm::RuntimeDyldError::convertToErrorCode
std::error_code convertToErrorCode() const override
Convert this error to a std::error_code.
Definition: RuntimeDyld.cpp:64
llvm::object::OwningBinary
Definition: RuntimeDyld.h:36
llvm::RuntimeDyld::LoadedObjectInfo
Information about the loaded object.
Definition: RuntimeDyld.h:69
llvm::SectionName
Definition: DWARFSection.h:21
llvm::Error
Lightweight error class with error context and mandatory checking.
Definition: Error.h:157
llvm::RuntimeDyld::getErrorString
StringRef getErrorString()
Definition: RuntimeDyld.cpp:1412
llvm::LoadedObjectInfo
An inferface for inquiring the load address of a loaded object file to be used by the DIContext imple...
Definition: DIContext.h:253
llvm::RuntimeDyld::getSymbolLocalAddress
void * getSymbolLocalAddress(StringRef Name) const
Get the address of our local copy of the symbol.
Definition: RuntimeDyld.cpp:1376
llvm::RuntimeDyld::MemoryManager::allowStubAllocation
virtual bool allowStubAllocation() const
Override to return false to tell LLVM no stub space will be needed.
Definition: RuntimeDyld.h:149
llvm::RuntimeDyld::deregisterEHFrames
void deregisterEHFrames()
Definition: RuntimeDyld.cpp:1440
llvm::RuntimeDyld::getSymbol
JITEvaluatedSymbol getSymbol(StringRef Name) const
Get the target address and flags for the named symbol.
Definition: RuntimeDyld.cpp:1387
llvm::RuntimeDyld::MemoryManager::TLSSection
An allocated TLS section.
Definition: RuntimeDyld.h:116
llvm::RuntimeDyld
Definition: RuntimeDyld.h:58
llvm::RuntimeDyldError::ID
static char ID
Definition: RuntimeDyld.h:44
llvm::RuntimeDyld::MemoryManager::allocateDataSection
virtual uint8_t * allocateDataSection(uintptr_t Size, unsigned Alignment, unsigned SectionID, StringRef SectionName, bool IsReadOnly)=0
Allocate a memory block of (at least) the given size suitable for data.
llvm::RuntimeDyld::hasError
bool hasError()
Definition: RuntimeDyld.cpp:1410
llvm::RuntimeDyld::mapSectionAddress
void mapSectionAddress(const void *LocalAddress, uint64_t TargetAddress)
Map a section to its target address space value.
Definition: RuntimeDyld.cpp:1405
llvm::RuntimeDyld::MemoryManager::allocateTLSSection
virtual TLSSection allocateTLSSection(uintptr_t Size, unsigned Alignment, unsigned SectionID, StringRef SectionName)
Allocate a memory block of (at least) the given size to be used for thread-local storage (TLS).
Definition: RuntimeDyld.cpp:1286
llvm::RuntimeDyld::getSymbolTable
std::map< StringRef, JITEvaluatedSymbol > getSymbolTable() const
Returns a copy of the symbol table.
Definition: RuntimeDyld.cpp:1393
llvm::RuntimeDyld::MemoryManager
Memory Management.
Definition: RuntimeDyld.h:92