This threads SectionName through the allocateCodeSection/allocateDataSection APIs...
authorFilip Pizlo <fpizlo@apple.com>
Wed, 2 Oct 2013 00:59:25 +0000 (00:59 +0000)
committerFilip Pizlo <fpizlo@apple.com>
Wed, 2 Oct 2013 00:59:25 +0000 (00:59 +0000)
It's useful for the memory managers that are allocating a section to know what the name of the section is.
At a minimum, this is useful for low-level debugging - it's customary for JITs to be able to tell you what
memory they allocated, and as part of any such dump, they should be able to tell you some meta-data about
what each allocation is for.  This allows clients that supply their own memory managers to do this.
Additionally, we also envision the SectionName being useful for passing meta-data from within LLVM to an LLVM
client.

This changes both the C and C++ APIs, and all of the clients of those APIs within LLVM.  I'm assuming that
it's safe to change the C++ API because that API is allowed to change.  I'm assuming that it's safe to change
the C API because we haven't shipped the API in a release yet (LLVM 3.3 doesn't include the MCJIT memory
management C API).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@191804 91177308-0d34-0410-b5e6-96231b3b80d8

16 files changed:
include/llvm-c/ExecutionEngine.h
include/llvm/ExecutionEngine/RTDyldMemoryManager.h
include/llvm/ExecutionEngine/SectionMemoryManager.h
lib/ExecutionEngine/ExecutionEngineBindings.cpp
lib/ExecutionEngine/JIT/JITMemoryManager.cpp
lib/ExecutionEngine/MCJIT/MCJIT.h
lib/ExecutionEngine/MCJIT/SectionMemoryManager.cpp
lib/ExecutionEngine/RuntimeDyld/RuntimeDyld.cpp
lib/ExecutionEngine/RuntimeDyld/RuntimeDyldELF.cpp
tools/lli/RecordingMemoryManager.cpp
tools/lli/RecordingMemoryManager.h
tools/llvm-rtdyld/llvm-rtdyld.cpp
unittests/ExecutionEngine/JIT/JITMemoryManagerTest.cpp
unittests/ExecutionEngine/JIT/JITTest.cpp
unittests/ExecutionEngine/MCJIT/MCJITCAPITest.cpp
unittests/ExecutionEngine/MCJIT/MCJITMemoryManagerTest.cpp

index cf3565c217ea4026e4fd1b3d31d930f8456f22a6..4e767b2e6418cd28d83fc6b8095ba93ab2aa9135 100644 (file)
@@ -171,13 +171,14 @@ void *LLVMGetPointerToGlobal(LLVMExecutionEngineRef EE, LLVMValueRef Global);
 
 /*===-- Operations on memory managers -------------------------------------===*/
 
-typedef uint8_t *(*LLVMMemoryManagerAllocateCodeSectionCallback)(void *Opaque,
-                                                   uintptr_t Size, unsigned Alignment,
-                                                   unsigned SectionID);
-typedef uint8_t *(*LLVMMemoryManagerAllocateDataSectionCallback)(void *Opaque,
-                                                   uintptr_t Size, unsigned Alignment,
-                                                   unsigned SectionID, LLVMBool IsReadOnly);
-typedef LLVMBool (*LLVMMemoryManagerFinalizeMemoryCallback)(void *Opaque, char **ErrMsg);
+typedef uint8_t *(*LLVMMemoryManagerAllocateCodeSectionCallback)(
+  void *Opaque, uintptr_t Size, unsigned Alignment, unsigned SectionID,
+  const char *SectionName);
+typedef uint8_t *(*LLVMMemoryManagerAllocateDataSectionCallback)(
+  void *Opaque, uintptr_t Size, unsigned Alignment, unsigned SectionID,
+  const char *SectionName, LLVMBool IsReadOnly);
+typedef LLVMBool (*LLVMMemoryManagerFinalizeMemoryCallback)(
+  void *Opaque, char **ErrMsg);
 typedef void (*LLVMMemoryManagerDestroyCallback)(void *Opaque);
 
 /**
index 02e6b19b91cf48dd5908448e59f1b57a1649d54a..59326875850d66e838dc3e8847a0e209a2570593 100644 (file)
@@ -38,14 +38,16 @@ public:
   /// executable code. The SectionID is a unique identifier assigned by the JIT
   /// engine, and optionally recorded by the memory manager to access a loaded
   /// section.
-  virtual uint8_t *allocateCodeSection(uintptr_t Size, unsigned Alignment,
-                                       unsigned SectionID) = 0;
-
+  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 data.
   /// The SectionID is a unique identifier assigned by the JIT engine, and
   /// optionally recorded by the memory manager to access a loaded section.
-  virtual uint8_t *allocateDataSection(uintptr_t Size, unsigned Alignment,
-                                       unsigned SectionID, bool IsReadOnly) = 0;
+  virtual uint8_t *allocateDataSection(
+    uintptr_t Size, unsigned Alignment, unsigned SectionID,
+    StringRef SectionName, bool IsReadOnly) = 0;
 
   /// Register the EH frames with the runtime so that c++ exceptions work.
   virtual void registerEHFrames(StringRef SectionData);
index 6ee2a2aae59042c50a9acac7786413375a36e735..fd6e41f91ffb4b055e841e0f84302385acdaa6f8 100644 (file)
@@ -49,7 +49,8 @@ public:
   /// The value of \p Alignment must be a power of two.  If \p Alignment is zero
   /// a default alignment of 16 will be used.
   virtual uint8_t *allocateCodeSection(uintptr_t Size, unsigned Alignment,
-                                       unsigned SectionID);
+                                       unsigned SectionID,
+                                       StringRef SectionName);
 
   /// \brief Allocates a memory block of (at least) the given size suitable for
   /// executable code.
@@ -58,6 +59,7 @@ public:
   /// a default alignment of 16 will be used.
   virtual uint8_t *allocateDataSection(uintptr_t Size, unsigned Alignment,
                                        unsigned SectionID,
+                                       StringRef SectionName,
                                        bool isReadOnly);
 
   /// \brief Update section-specific memory permissions and other attributes.
index 941444578213fbf669669e45a7de23acd3fe7f8e..2d34eeabf2a97525b0f266e215145bebbeb2d9c0 100644 (file)
@@ -351,12 +351,13 @@ public:
                              void *Opaque);
   virtual ~SimpleBindingMemoryManager();
   
-  virtual uint8_t *allocateCodeSection(uintptr_t Size, unsigned Alignment,
-                                       unsigned SectionID);
+  virtual uint8_t *allocateCodeSection(
+    uintptr_t Size, unsigned Alignment, unsigned SectionID,
+    StringRef SectionName);
 
-  virtual uint8_t *allocateDataSection(uintptr_t Size, unsigned Alignment,
-                                       unsigned SectionID,
-                                       bool isReadOnly);
+  virtual uint8_t *allocateDataSection(
+    uintptr_t Size, unsigned Alignment, unsigned SectionID,
+    StringRef SectionName, bool isReadOnly);
 
   virtual bool finalizeMemory(std::string *ErrMsg);
   
@@ -384,13 +385,17 @@ SimpleBindingMemoryManager::~SimpleBindingMemoryManager() {
 }
 
 uint8_t *SimpleBindingMemoryManager::allocateCodeSection(
-  uintptr_t Size, unsigned Alignment, unsigned SectionID) {
-  return Functions.AllocateCodeSection(Opaque, Size, Alignment, SectionID);
+  uintptr_t Size, unsigned Alignment, unsigned SectionID,
+  StringRef SectionName) {
+  return Functions.AllocateCodeSection(Opaque, Size, Alignment, SectionID,
+                                       SectionName.str().c_str());
 }
 
 uint8_t *SimpleBindingMemoryManager::allocateDataSection(
-  uintptr_t Size, unsigned Alignment, unsigned SectionID, bool isReadOnly) {
+  uintptr_t Size, unsigned Alignment, unsigned SectionID,
+  StringRef SectionName, bool isReadOnly) {
   return Functions.AllocateDataSection(Opaque, Size, Alignment, SectionID,
+                                       SectionName.str().c_str(),
                                        isReadOnly);
 }
 
index 94db2459877b3cea76963f8ed16dcafcd36236c1..92ea13e5c4f69018cc95d8571ea334561d591791 100644 (file)
@@ -464,7 +464,7 @@ namespace {
 
     /// allocateCodeSection - Allocate memory for a code section.
     uint8_t *allocateCodeSection(uintptr_t Size, unsigned Alignment,
-                                 unsigned SectionID) {
+                                 unsigned SectionID, StringRef SectionName) {
       // Grow the required block size to account for the block header
       Size += sizeof(*CurBlock);
 
@@ -510,7 +510,8 @@ namespace {
 
     /// allocateDataSection - Allocate memory for a data section.
     uint8_t *allocateDataSection(uintptr_t Size, unsigned Alignment,
-                                 unsigned SectionID, bool IsReadOnly) {
+                                 unsigned SectionID, StringRef SectionName,
+                                 bool IsReadOnly) {
       return (uint8_t*)DataAllocator.Allocate(Size, Alignment);
     }
 
index 5fb2eebd92ae0f95b8fa128d6072269e1f254299..a40a9e429bed41ecfb67af43c7686ec9d9a7d862 100644 (file)
@@ -35,14 +35,15 @@ public:
 
   // Functions deferred to client memory manager
   virtual uint8_t *allocateCodeSection(uintptr_t Size, unsigned Alignment,
-                                       unsigned SectionID) {
-    return ClientMM->allocateCodeSection(Size, Alignment, SectionID);
+                                       unsigned SectionID, StringRef SectionName) {
+    return ClientMM->allocateCodeSection(Size, Alignment, SectionID, SectionName);
   }
 
   virtual uint8_t *allocateDataSection(uintptr_t Size, unsigned Alignment,
-                                       unsigned SectionID, bool IsReadOnly) {
+                                       unsigned SectionID, StringRef SectionName,
+                                       bool IsReadOnly) {
     return ClientMM->allocateDataSection(Size, Alignment,
-                                         SectionID, IsReadOnly);
+                                         SectionID, SectionName, IsReadOnly);
   }
 
   virtual void registerEHFrames(StringRef SectionData) {
index 5469c8374b1a0ff042eaaeb479db441c6ad6f059..cf90e77e38951121ae9940d69c22d9f0ad8a3a91 100644 (file)
 namespace llvm {
 
 uint8_t *SectionMemoryManager::allocateDataSection(uintptr_t Size,
-                                                    unsigned Alignment,
-                                                    unsigned SectionID,
-                                                    bool IsReadOnly) {
+                                                   unsigned Alignment,
+                                                   unsigned SectionID,
+                                                   StringRef SectionName,
+                                                   bool IsReadOnly) {
   if (IsReadOnly)
     return allocateSection(RODataMem, Size, Alignment);
   return allocateSection(RWDataMem, Size, Alignment);
@@ -29,7 +30,8 @@ uint8_t *SectionMemoryManager::allocateDataSection(uintptr_t Size,
 
 uint8_t *SectionMemoryManager::allocateCodeSection(uintptr_t Size,
                                                    unsigned Alignment,
-                                                   unsigned SectionID) {
+                                                   unsigned SectionID,
+                                                   StringRef SectionName) {
   return allocateSection(CodeMem, Size, Alignment);
 }
 
index 89c04dd007b867f75b241482d33b54735d635355..077442d8dfb10e95f59c8ad62a0933f2823c0bcd 100644 (file)
@@ -182,8 +182,8 @@ void RuntimeDyldImpl::emitCommonSymbols(ObjectImage &Obj,
                                         SymbolTableMap &SymbolTable) {
   // Allocate memory for the section
   unsigned SectionID = Sections.size();
-  uint8_t *Addr = MemMgr->allocateDataSection(TotalSize, sizeof(void*),
-                                              SectionID, false);
+  uint8_t *Addr = MemMgr->allocateDataSection(
+    TotalSize, sizeof(void*), SectionID, StringRef(), false);
   if (!Addr)
     report_fatal_error("Unable to allocate memory for common symbols!");
   uint64_t Offset = 0;
@@ -278,8 +278,9 @@ unsigned RuntimeDyldImpl::emitSection(ObjectImage &Obj,
   if (IsRequired) {
     Allocate = DataSize + StubBufSize;
     Addr = IsCode
-      ? MemMgr->allocateCodeSection(Allocate, Alignment, SectionID)
-      : MemMgr->allocateDataSection(Allocate, Alignment, SectionID, IsReadOnly);
+      ? MemMgr->allocateCodeSection(Allocate, Alignment, SectionID, Name)
+      : MemMgr->allocateDataSection(Allocate, Alignment, SectionID, Name,
+                                    IsReadOnly);
     if (!Addr)
       report_fatal_error("Unable to allocate section memory!");
 
index 6504f0e2d758bf007fc88aed1b3c8a9ba9306b46..eb2a1a771d7490a4d8411810534e0d4c7fdb033e 100644 (file)
@@ -1337,8 +1337,8 @@ void RuntimeDyldELF::finalizeLoad() {
     // Allocate memory for the section
     unsigned SectionID = Sections.size();
     size_t TotalSize = numGOTEntries * getGOTEntrySize();
-    uint8_t *Addr = MemMgr->allocateDataSection(TotalSize, getGOTEntrySize(),
-                                                SectionID, false);
+    uint8_t *Addr = MemMgr->allocateDataSection(
+      TotalSize, getGOTEntrySize(), SectionID, ".got", false);
     if (!Addr)
       report_fatal_error("Unable to allocate memory for GOT!");
     Sections.push_back(SectionEntry(".got", Addr, TotalSize, 0));
index ec55d2cd30e3d776315c2d8e743eb764dbfda552..d54b8e434d08fecfaf7520532e1afc870d07c1d4 100644 (file)
@@ -27,7 +27,8 @@ RecordingMemoryManager::~RecordingMemoryManager() {
 }
 
 uint8_t *RecordingMemoryManager::
-allocateCodeSection(uintptr_t Size, unsigned Alignment, unsigned SectionID) {
+allocateCodeSection(uintptr_t Size, unsigned Alignment, unsigned SectionID,
+                    StringRef SectionName) {
   // The recording memory manager is just a local copy of the remote target.
   // The alignment requirement is just stored here for later use. Regular
   // heap storage is sufficient here, but we're using mapped memory to work
@@ -39,7 +40,8 @@ allocateCodeSection(uintptr_t Size, unsigned Alignment, unsigned SectionID) {
 
 uint8_t *RecordingMemoryManager::
 allocateDataSection(uintptr_t Size, unsigned Alignment,
-                    unsigned SectionID, bool IsReadOnly) {
+                    unsigned SectionID, StringRef SectionName,
+                    bool IsReadOnly) {
   // The recording memory manager is just a local copy of the remote target.
   // The alignment requirement is just stored here for later use. Regular
   // heap storage is sufficient here, but we're using mapped memory to work
index b2919c39790a3ebc4689e3c0dcf2725871a56189..05f4807d0454cb9f5ab6684fe7676cbb43b7fe5b 100644 (file)
@@ -50,10 +50,11 @@ public:
   const_code_iterator   code_end() const { return AllocatedCodeMem.end(); }
 
   uint8_t *allocateCodeSection(uintptr_t Size, unsigned Alignment,
-                                       unsigned SectionID);
+                               unsigned SectionID, StringRef SectionName);
 
   uint8_t *allocateDataSection(uintptr_t Size, unsigned Alignment,
-                                       unsigned SectionID, bool IsReadOnly);
+                               unsigned SectionID, StringRef SectionName,
+                               bool IsReadOnly);
 
   void *getPointerToNamedFunction(const std::string &Name,
                                   bool AbortOnFailure = true);
index 7f042d2ef2426906575677541bbbd4b3e6fb4322..c5c285431a4d5ec285cf26147fcc9d142bb82e2a 100644 (file)
@@ -60,9 +60,10 @@ public:
   SmallVector<sys::MemoryBlock, 16> DataMemory;
 
   uint8_t *allocateCodeSection(uintptr_t Size, unsigned Alignment,
-                               unsigned SectionID);
+                               unsigned SectionID, StringRef SectionName);
   uint8_t *allocateDataSection(uintptr_t Size, unsigned Alignment,
-                               unsigned SectionID, bool IsReadOnly);
+                               unsigned SectionID, StringRef SectionName,
+                               bool IsReadOnly);
 
   virtual void *getPointerToNamedFunction(const std::string &Name,
                                           bool AbortOnFailure = true) {
@@ -80,7 +81,8 @@ public:
 
 uint8_t *TrivialMemoryManager::allocateCodeSection(uintptr_t Size,
                                                    unsigned Alignment,
-                                                   unsigned SectionID) {
+                                                   unsigned SectionID,
+                                                   StringRef SectionName) {
   sys::MemoryBlock MB = sys::Memory::AllocateRWX(Size, 0, 0);
   FunctionMemory.push_back(MB);
   return (uint8_t*)MB.base();
@@ -89,6 +91,7 @@ uint8_t *TrivialMemoryManager::allocateCodeSection(uintptr_t Size,
 uint8_t *TrivialMemoryManager::allocateDataSection(uintptr_t Size,
                                                    unsigned Alignment,
                                                    unsigned SectionID,
+                                                   StringRef SectionName,
                                                    bool IsReadOnly) {
   sys::MemoryBlock MB = sys::Memory::AllocateRWX(Size, 0, 0);
   DataMemory.push_back(MB);
index 68ca53d4e6c25647674bbbc9e4bd8c8d48cd4c04..731f7807f59343b68ab8761e7edbb0308c780fa2 100644 (file)
@@ -281,11 +281,11 @@ TEST(JITMemoryManagerTest, TestManyStubs) {
 TEST(JITMemoryManagerTest, AllocateSection) {
   OwningPtr<JITMemoryManager> MemMgr(
       JITMemoryManager::CreateDefaultMemManager());
-  uint8_t *code1 = MemMgr->allocateCodeSection(256, 0, 1);
-  uint8_t *data1 = MemMgr->allocateDataSection(256, 16, 2, true);
-  uint8_t *code2 = MemMgr->allocateCodeSection(257, 32, 3);
-  uint8_t *data2 = MemMgr->allocateDataSection(256, 64, 4, false);
-  uint8_t *code3 = MemMgr->allocateCodeSection(258, 64, 5);
+  uint8_t *code1 = MemMgr->allocateCodeSection(256, 0, 1, StringRef());
+  uint8_t *data1 = MemMgr->allocateDataSection(256, 16, 2, StringRef(), true);
+  uint8_t *code2 = MemMgr->allocateCodeSection(257, 32, 3, StringRef());
+  uint8_t *data2 = MemMgr->allocateDataSection(256, 64, 4, StringRef(), false);
+  uint8_t *code3 = MemMgr->allocateCodeSection(258, 64, 5, StringRef());
 
   EXPECT_NE((uint8_t*)0, code1);
   EXPECT_NE((uint8_t*)0, code2);
index 3b94d76d76bdc548b87195764d8f8224b149e74a..73976ab0f923099237fdf1bfc7c2bd18ecf373b8 100644 (file)
@@ -135,13 +135,17 @@ public:
       EndFunctionBodyCall(F, FunctionStart, FunctionEnd));
     Base->endFunctionBody(F, FunctionStart, FunctionEnd);
   }
-  virtual uint8_t *allocateDataSection(uintptr_t Size, unsigned Alignment,
-                                       unsigned SectionID, bool IsReadOnly) {
-    return Base->allocateDataSection(Size, Alignment, SectionID, IsReadOnly);
+  virtual uint8_t *allocateDataSection(
+    uintptr_t Size, unsigned Alignment, unsigned SectionID,
+    StringRef SectionName, bool IsReadOnly) {
+    return Base->allocateDataSection(
+      Size, Alignment, SectionID, SectionName, IsReadOnly);
   }
-  virtual uint8_t *allocateCodeSection(uintptr_t Size, unsigned Alignment,
-                                       unsigned SectionID) {
-    return Base->allocateCodeSection(Size, Alignment, SectionID);
+  virtual uint8_t *allocateCodeSection(
+    uintptr_t Size, unsigned Alignment, unsigned SectionID,
+    StringRef SectionName) {
+    return Base->allocateCodeSection(
+      Size, Alignment, SectionID, SectionName);
   }
   virtual bool finalizeMemory(std::string *ErrMsg) { return false; }
   virtual uint8_t *allocateSpace(intptr_t Size, unsigned Alignment) {
index c434a7c0b25b149e121dd8d3bec8b31051143c42..e4197ddced618d8954b662d30b9cee6d3275232c 100644 (file)
@@ -28,18 +28,20 @@ static bool didCallAllocateCodeSection;
 
 static uint8_t *roundTripAllocateCodeSection(void *object, uintptr_t size,
                                              unsigned alignment,
-                                             unsigned sectionID) {
+                                             unsigned sectionID,
+                                             const char *sectionName) {
   didCallAllocateCodeSection = true;
   return static_cast<SectionMemoryManager*>(object)->allocateCodeSection(
-    size, alignment, sectionID);
+    size, alignment, sectionID, sectionName);
 }
 
 static uint8_t *roundTripAllocateDataSection(void *object, uintptr_t size,
                                              unsigned alignment,
                                              unsigned sectionID,
+                                             const char *sectionName,
                                              LLVMBool isReadOnly) {
   return static_cast<SectionMemoryManager*>(object)->allocateDataSection(
-    size, alignment, sectionID, isReadOnly);
+    size, alignment, sectionID, sectionName, isReadOnly);
 }
 
 static LLVMBool roundTripFinalizeMemory(void *object, char **errMsg) {
index f6dbf984508ab4c85532b22e9550caad11785359..c24346de84eeed0335459895cdfbcf8bddeade50 100644 (file)
@@ -19,10 +19,10 @@ namespace {
 TEST(MCJITMemoryManagerTest, BasicAllocations) {
   OwningPtr<SectionMemoryManager> MemMgr(new SectionMemoryManager());
 
-  uint8_t *code1 = MemMgr->allocateCodeSection(256, 0, 1);
-  uint8_t *data1 = MemMgr->allocateDataSection(256, 0, 2, true);
-  uint8_t *code2 = MemMgr->allocateCodeSection(256, 0, 3);
-  uint8_t *data2 = MemMgr->allocateDataSection(256, 0, 4, false);
+  uint8_t *code1 = MemMgr->allocateCodeSection(256, 0, 1, "");
+  uint8_t *data1 = MemMgr->allocateDataSection(256, 0, 2, "", true);
+  uint8_t *code2 = MemMgr->allocateCodeSection(256, 0, 3, "");
+  uint8_t *data2 = MemMgr->allocateDataSection(256, 0, 4, "", false);
 
   EXPECT_NE((uint8_t*)0, code1);
   EXPECT_NE((uint8_t*)0, code2);
@@ -52,10 +52,10 @@ TEST(MCJITMemoryManagerTest, BasicAllocations) {
 TEST(MCJITMemoryManagerTest, LargeAllocations) {
   OwningPtr<SectionMemoryManager> MemMgr(new SectionMemoryManager());
 
-  uint8_t *code1 = MemMgr->allocateCodeSection(0x100000, 0, 1);
-  uint8_t *data1 = MemMgr->allocateDataSection(0x100000, 0, 2, true);
-  uint8_t *code2 = MemMgr->allocateCodeSection(0x100000, 0, 3);
-  uint8_t *data2 = MemMgr->allocateDataSection(0x100000, 0, 4, false);
+  uint8_t *code1 = MemMgr->allocateCodeSection(0x100000, 0, 1, "");
+  uint8_t *data1 = MemMgr->allocateDataSection(0x100000, 0, 2, "", true);
+  uint8_t *code2 = MemMgr->allocateCodeSection(0x100000, 0, 3, "");
+  uint8_t *data2 = MemMgr->allocateDataSection(0x100000, 0, 4, "", false);
 
   EXPECT_NE((uint8_t*)0, code1);
   EXPECT_NE((uint8_t*)0, code2);
@@ -91,8 +91,8 @@ TEST(MCJITMemoryManagerTest, ManyAllocations) {
   for (unsigned i = 0; i < 10000; ++i) {
     const bool isReadOnly = i % 2 == 0;
 
-    code[i] = MemMgr->allocateCodeSection(32, 0, 1);
-    data[i] = MemMgr->allocateDataSection(32, 0, 2, isReadOnly);
+    code[i] = MemMgr->allocateCodeSection(32, 0, 1, "");
+    data[i] = MemMgr->allocateDataSection(32, 0, 2, "", isReadOnly);
 
     for (unsigned j = 0; j < 32; j++) {
       code[i][j] = 1 + (i % 254);
@@ -130,8 +130,8 @@ TEST(MCJITMemoryManagerTest, ManyVariedAllocations) {
     bool isReadOnly = i % 3 == 0;
     unsigned Align = 8 << (i % 4);
 
-    code[i] = MemMgr->allocateCodeSection(CodeSize, Align, i);
-    data[i] = MemMgr->allocateDataSection(DataSize, Align, i + 10000,
+    code[i] = MemMgr->allocateCodeSection(CodeSize, Align, i, "");
+    data[i] = MemMgr->allocateDataSection(DataSize, Align, i + 10000, "",
                                           isReadOnly);
 
     for (unsigned j = 0; j < CodeSize; j++) {