diff options
author | James Molloy <james.molloy@arm.com> | 2014-04-14 13:54:16 +0000 |
---|---|---|
committer | James Molloy <james.molloy@arm.com> | 2014-04-14 13:54:16 +0000 |
commit | 951e529f6623d74c86c2e708dabca57779ef3d9b (patch) | |
tree | 535cb7790fdb9dc640831cd2ce9efdcb73b7c736 /llvm/lib/LTO | |
parent | f434c4fa3f86cacb7a9cee2f9ca827caf933fc0c (diff) | |
download | bcm5719-llvm-951e529f6623d74c86c2e708dabca57779ef3d9b.tar.gz bcm5719-llvm-951e529f6623d74c86c2e708dabca57779ef3d9b.zip |
Teach llvm-lto to respect the given RelocModel.
Patch by Nick Tomlinson!
llvm-svn: 206177
Diffstat (limited to 'llvm/lib/LTO')
-rw-r--r-- | llvm/lib/LTO/LTOCodeGenerator.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/llvm/lib/LTO/LTOCodeGenerator.cpp b/llvm/lib/LTO/LTOCodeGenerator.cpp index 7fe143bd5d6..2ba90fad848 100644 --- a/llvm/lib/LTO/LTOCodeGenerator.cpp +++ b/llvm/lib/LTO/LTOCodeGenerator.cpp @@ -65,7 +65,7 @@ const char* LTOCodeGenerator::getVersionString() { LTOCodeGenerator::LTOCodeGenerator() : Context(getGlobalContext()), Linker(new Module("ld-temp.o", Context)), TargetMach(NULL), EmitDwarfDebugInfo(false), ScopeRestrictionsDone(false), - CodeModel(LTO_CODEGEN_PIC_MODEL_DYNAMIC), NativeObjectFile(NULL), + CodeModel(LTO_CODEGEN_PIC_MODEL_DEFAULT), NativeObjectFile(NULL), DiagHandler(NULL), DiagContext(NULL) { initializeLTOPasses(); } @@ -161,6 +161,7 @@ void LTOCodeGenerator::setCodePICModel(lto_codegen_model model) { case LTO_CODEGEN_PIC_MODEL_STATIC: case LTO_CODEGEN_PIC_MODEL_DYNAMIC: case LTO_CODEGEN_PIC_MODEL_DYNAMIC_NO_PIC: + case LTO_CODEGEN_PIC_MODEL_DEFAULT: CodeModel = model; return; } @@ -295,6 +296,9 @@ bool LTOCodeGenerator::determineTarget(std::string &errMsg) { case LTO_CODEGEN_PIC_MODEL_DYNAMIC_NO_PIC: RelocModel = Reloc::DynamicNoPIC; break; + case LTO_CODEGEN_PIC_MODEL_DEFAULT: + // RelocModel is already the default, so leave it that way. + break; } // construct LTOModule, hand over ownership of module and target |