forked from OSchip/llvm-project
parent
3f9568e921
commit
2ed4dc9f27
|
@ -601,10 +601,15 @@ ClangExpressionParser::PrepareForExecution (lldb::addr_t &func_allocation_addr,
|
|||
}
|
||||
llvm::Triple triple(module_ap->getTargetTriple());
|
||||
llvm::Function *function = module_ap->getFunction (function_name.c_str());
|
||||
llvm::Reloc::Model relocModel;
|
||||
if (triple.isOSBinFormatELF())
|
||||
relocModel = llvm::Reloc::Static;
|
||||
else
|
||||
relocModel = llvm::Reloc::PIC_;
|
||||
EngineBuilder builder(module_ap.release());
|
||||
builder.setEngineKind(EngineKind::JIT)
|
||||
.setErrorStr(&error_string)
|
||||
.setRelocationModel(llvm::Reloc::PIC_)
|
||||
.setRelocationModel(relocModel)
|
||||
.setJITMemoryManager(jit_memory_manager)
|
||||
.setOptLevel(CodeGenOpt::Less)
|
||||
.setAllocateGVsWithCode(true)
|
||||
|
|
|
@ -294,6 +294,8 @@ RecordingMemoryManager::ReportAllocations (llvm::ExecutionEngine &engine)
|
|||
|
||||
engine.mapSectionAddress((void*)ai->m_local_start, ai->m_remote_start);
|
||||
}
|
||||
// Trigger re-application of relocations.
|
||||
engine.finalizeObject();
|
||||
}
|
||||
|
||||
bool
|
||||
|
|
Loading…
Reference in New Issue