[Lldb-commits] [lldb] r175671 - Change ELF relocation model to static

Andrew Kaylor andrew.kaylor at intel.com
Wed Feb 20 13:39:02 PST 2013


Author: akaylor
Date: Wed Feb 20 15:39:02 2013
New Revision: 175671

URL: http://llvm.org/viewvc/llvm-project?rev=175671&view=rev
Log:
Change ELF relocation model to static

Modified:
    lldb/trunk/source/Expression/ClangExpressionParser.cpp
    lldb/trunk/source/Expression/RecordingMemoryManager.cpp

Modified: lldb/trunk/source/Expression/ClangExpressionParser.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Expression/ClangExpressionParser.cpp?rev=175671&r1=175670&r2=175671&view=diff
==============================================================================
--- lldb/trunk/source/Expression/ClangExpressionParser.cpp (original)
+++ lldb/trunk/source/Expression/ClangExpressionParser.cpp Wed Feb 20 15:39:02 2013
@@ -601,10 +601,15 @@ ClangExpressionParser::PrepareForExecuti
     }
     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)

Modified: lldb/trunk/source/Expression/RecordingMemoryManager.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Expression/RecordingMemoryManager.cpp?rev=175671&r1=175670&r2=175671&view=diff
==============================================================================
--- lldb/trunk/source/Expression/RecordingMemoryManager.cpp (original)
+++ lldb/trunk/source/Expression/RecordingMemoryManager.cpp Wed Feb 20 15:39:02 2013
@@ -294,6 +294,8 @@ RecordingMemoryManager::ReportAllocation
         
         engine.mapSectionAddress((void*)ai->m_local_start, ai->m_remote_start);
     }
+    // Trigger re-application of relocations.
+    engine.finalizeObject();
 }
 
 bool





More information about the lldb-commits mailing list