diff options
Diffstat (limited to 'ELF/LTO.cpp')
-rw-r--r-- | ELF/LTO.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/ELF/LTO.cpp b/ELF/LTO.cpp index dd435173101a..6915d9713891 100644 --- a/ELF/LTO.cpp +++ b/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; |