summaryrefslogtreecommitdiff
path: root/tools/llvm-lto
diff options
context:
space:
mode:
authorJames Molloy <james.molloy@arm.com>2014-04-14 13:54:16 +0000
committerJames Molloy <james.molloy@arm.com>2014-04-14 13:54:16 +0000
commit555f97f2bc7cc9215734edbdc0c180a341fc3748 (patch)
treea04d1b1263f42166f78a033a7e5c2b445da1125f /tools/llvm-lto
parentf86c5472c00b89ddb8980ae17c6568e9619aaf54 (diff)
Teach llvm-lto to respect the given RelocModel.
Patch by Nick Tomlinson! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@206177 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools/llvm-lto')
-rw-r--r--tools/llvm-lto/llvm-lto.cpp15
1 files changed, 14 insertions, 1 deletions
diff --git a/tools/llvm-lto/llvm-lto.cpp b/tools/llvm-lto/llvm-lto.cpp
index ec3f0fa2333..05ffbf31910 100644
--- a/tools/llvm-lto/llvm-lto.cpp
+++ b/tools/llvm-lto/llvm-lto.cpp
@@ -83,7 +83,20 @@ int main(int argc, char **argv) {
LTOCodeGenerator CodeGen;
- CodeGen.setCodePICModel(LTO_CODEGEN_PIC_MODEL_DYNAMIC);
+ switch (RelocModel) {
+ case Reloc::Static:
+ CodeGen.setCodePICModel(LTO_CODEGEN_PIC_MODEL_STATIC);
+ break;
+ case Reloc::PIC_:
+ CodeGen.setCodePICModel(LTO_CODEGEN_PIC_MODEL_DYNAMIC);
+ break;
+ case Reloc::DynamicNoPIC:
+ CodeGen.setCodePICModel(LTO_CODEGEN_PIC_MODEL_DYNAMIC_NO_PIC);
+ break;
+ default:
+ CodeGen.setCodePICModel(LTO_CODEGEN_PIC_MODEL_DEFAULT);
+ }
+
CodeGen.setDebugInfo(LTO_DEBUG_MODEL_DWARF);
CodeGen.setTargetOptions(Options);