LTO: Use the correct relocation model.
llvm-svn: 262492
diff --git a/lld/ELF/SymbolTable.cpp b/lld/ELF/SymbolTable.cpp
index 6892968..68a28c1 100644
--- a/lld/ELF/SymbolTable.cpp
+++ b/lld/ELF/SymbolTable.cpp
@@ -112,8 +112,9 @@
fatal("Target not found: " + ErrMsg);
TargetOptions Options;
+ Reloc::Model R = Config->Shared ? Reloc::PIC_ : Reloc::Static;
std::unique_ptr<TargetMachine> TM(
- TheTarget->createTargetMachine(TripleStr, "", "", Options));
+ TheTarget->createTargetMachine(TripleStr, "", "", Options, R));
raw_svector_ostream OS(OwningLTOData);
legacy::PassManager CodeGenPasses;