summaryrefslogtreecommitdiffstats
path: root/lld/ELF/LTO.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lld/ELF/LTO.cpp')
-rw-r--r--lld/ELF/LTO.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/lld/ELF/LTO.cpp b/lld/ELF/LTO.cpp
index dd435173101..6915d971389 100644
--- a/lld/ELF/LTO.cpp
+++ b/lld/ELF/LTO.cpp
@@ -73,7 +73,12 @@ static std::unique_ptr<lto::LTO> createLTO() {
Conf.Options = InitTargetOptionsFromCodeGenFlags();
Conf.Options.RelaxELFRelocations = true;
- Conf.RelocModel = Config->Pic ? Reloc::PIC_ : Reloc::Static;
+ if (Config->Relocatable)
+ Conf.RelocModel = None;
+ else if (Config->Pic)
+ Conf.RelocModel = Reloc::PIC_;
+ else
+ Conf.RelocModel = Reloc::Static;
Conf.CodeModel = GetCodeModelFromCMModel();
Conf.DisableVerify = Config->DisableVerify;
Conf.DiagHandler = diagnosticHandler;
OpenPOWER on IntegriCloud