summaryrefslogtreecommitdiff
path: root/ELF/LTO.cpp
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2017-05-29 16:26:20 +0000
committerDimitry Andric <dim@FreeBSD.org>2017-05-29 16:26:20 +0000
commitbef2946c219dc621608bcc9e47f8b973e5ef5c70 (patch)
tree1e4dfae199fc27167ed7496693938fec2dab65c2 /ELF/LTO.cpp
parentc53addf38e24e4dafe992aafb3ae928bfa8fdb0a (diff)
Notes
Diffstat (limited to 'ELF/LTO.cpp')
-rw-r--r--ELF/LTO.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/ELF/LTO.cpp b/ELF/LTO.cpp
index dd435173101a5..6915d9713891d 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;