aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp
diff options
context:
space:
mode:
authorFangrui Song <maskray@google.com>2020-03-19 22:58:42 -0700
committerFangrui Song <maskray@google.com>2020-03-20 21:57:34 -0700
commit85c30f3374d9f7f1124241ab09ce377fcb08d24d (patch)
treeb59f892142fad4e0a7f395a0640f3511ada71bd8 /llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp
parent7ece7c0faae39b5c57662b28e0e51b2a82ad34c3 (diff)
downloadllvm-85c30f3374d9f7f1124241ab09ce377fcb08d24d.zip
llvm-85c30f3374d9f7f1124241ab09ce377fcb08d24d.tar.gz
llvm-85c30f3374d9f7f1124241ab09ce377fcb08d24d.tar.bz2
[X86] Reland D71360 Clean up UseInitArray initialization for X86ELFTargetObjectFile
-fuse-init-array is now the CC1 default but TargetLoweringObjectFileELF::UseInitArray still defaults to false. The following two unknown OS target triples continue using .ctors/.dtors because InitializeELF is not called. clang -target i386 -c a.c clang -target x86_64 -c a.c This cleanup fixes this as a bonus. X86SpeculativeLoadHardeningPass::tracePredStateThroughCall can call MCContext::createTempSymbol before TargetLoweringObjectFileELF::Initialize(). We need to call TargetLoweringObjectFileELF::Initialize() ealier. test/CodeGen/X86/speculative-load-hardening-indirect.ll Differential Revision: https://reviews.llvm.org/D71360
Diffstat (limited to 'llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp')
-rw-r--r--llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp b/llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp
index 8f1c342..dedb673 100644
--- a/llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp
+++ b/llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp
@@ -108,6 +108,7 @@ void TargetLoweringObjectFileELF::Initialize(MCContext &Ctx,
TM = &TgtM;
CodeModel::Model CM = TgtM.getCodeModel();
+ InitializeELF(TgtM.Options.UseInitArray);
switch (TgtM.getTargetTriple().getArch()) {
case Triple::arm: