summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrew Kaylor <andrew.kaylor@intel.com>2013-02-20 21:39:02 +0000
committerAndrew Kaylor <andrew.kaylor@intel.com>2013-02-20 21:39:02 +0000
commit2ed4dc9f27716def86a187c11d3b1a97a20e9f03 (patch)
treeb611d83301704860d2b84e5e908bf1e472fa0546
parent3f9568e921d706b0755b5edb2f0649ef8485ef17 (diff)
downloadbcm5719-llvm-2ed4dc9f27716def86a187c11d3b1a97a20e9f03.tar.gz
bcm5719-llvm-2ed4dc9f27716def86a187c11d3b1a97a20e9f03.zip
Change ELF relocation model to static
llvm-svn: 175671
-rw-r--r--lldb/source/Expression/ClangExpressionParser.cpp7
-rw-r--r--lldb/source/Expression/RecordingMemoryManager.cpp2
2 files changed, 8 insertions, 1 deletions
diff --git a/lldb/source/Expression/ClangExpressionParser.cpp b/lldb/source/Expression/ClangExpressionParser.cpp
index a601b00aa55..7be3784088a 100644
--- a/lldb/source/Expression/ClangExpressionParser.cpp
+++ b/lldb/source/Expression/ClangExpressionParser.cpp
@@ -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)
diff --git a/lldb/source/Expression/RecordingMemoryManager.cpp b/lldb/source/Expression/RecordingMemoryManager.cpp
index 6dc202959f2..2a81fc2d125 100644
--- a/lldb/source/Expression/RecordingMemoryManager.cpp
+++ b/lldb/source/Expression/RecordingMemoryManager.cpp
@@ -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
OpenPOWER on IntegriCloud