Change ELF relocation model to static

llvm-svn: 175671
This commit is contained in:
Andrew Kaylor 2013-02-20 21:39:02 +00:00
parent 3f9568e921
commit 2ed4dc9f27
2 changed files with 8 additions and 1 deletions

View File

@ -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)

View File

@ -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