From: Andrew Lenharth Date: Mon, 1 Aug 2005 17:35:40 +0000 (+0000) Subject: one cannot allocate a global, until one is done initializing the global pointers X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=2b3b89c28e90ba9637614a398dc0eb743370a1c9;p=oota-llvm.git one cannot allocate a global, until one is done initializing the global pointers git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22568 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/ExecutionEngine/JIT/JITEmitter.cpp b/lib/ExecutionEngine/JIT/JITEmitter.cpp index 88a8be439f4..d1277081890 100644 --- a/lib/ExecutionEngine/JIT/JITEmitter.cpp +++ b/lib/ExecutionEngine/JIT/JITEmitter.cpp @@ -91,17 +91,17 @@ JITMemoryManager::JITMemoryManager(bool useGOT) { ConstantBase = reinterpret_cast(ConstBlock.base()); GlobalBase = reinterpret_cast(GVBlock.base()); - //Allocate the GOT just like a global array - GOTBase = NULL; - if (useGOT) - GOTBase = allocateGlobal(sizeof(void*) * 8192, 8); - // Allocate stubs backwards from the base, allocate functions forward // from the base. CurStubPtr = CurFunctionPtr = FunctionBase + 512*1024;// Use 512k for stubs CurConstantPtr = ConstantBase + ConstBlock.size(); CurGlobalPtr = GlobalBase + GVBlock.size(); + + //Allocate the GOT just like a global array + GOTBase = NULL; + if (useGOT) + GOTBase = allocateGlobal(sizeof(void*) * 8192, 8); } JITMemoryManager::~JITMemoryManager() {