diff options
Diffstat (limited to 'contrib/llvm-project/llvm/lib/Target/TargetLoweringObjectFile.cpp')
-rw-r--r-- | contrib/llvm-project/llvm/lib/Target/TargetLoweringObjectFile.cpp | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/contrib/llvm-project/llvm/lib/Target/TargetLoweringObjectFile.cpp b/contrib/llvm-project/llvm/lib/Target/TargetLoweringObjectFile.cpp index 81af4eead6d2..7954f0f09faf 100644 --- a/contrib/llvm-project/llvm/lib/Target/TargetLoweringObjectFile.cpp +++ b/contrib/llvm-project/llvm/lib/Target/TargetLoweringObjectFile.cpp @@ -44,7 +44,7 @@ void TargetLoweringObjectFile::Initialize(MCContext &ctx, // `Initialize` can be called more than once. delete Mang; Mang = new Mangler(); - InitMCObjectFileInfo(TM.getTargetTriple(), TM.isPositionIndependent(), ctx, + initMCObjectFileInfo(ctx, TM.isPositionIndependent(), TM.getCodeModel() == CodeModel::Large); // Reset various EH DWARF encodings. @@ -217,8 +217,14 @@ SectionKind TargetLoweringObjectFile::getKindForGlobal(const GlobalObject *GO, // Handle thread-local data first. if (GVar->isThreadLocal()) { - if (isSuitableForBSS(GVar) && !TM.Options.NoZerosInBSS) + if (isSuitableForBSS(GVar) && !TM.Options.NoZerosInBSS) { + // Zero-initialized TLS variables with local linkage always get classified + // as ThreadBSSLocal. + if (GVar->hasLocalLinkage()) { + return SectionKind::getThreadBSSLocal(); + } return SectionKind::getThreadBSS(); + } return SectionKind::getThreadData(); } @@ -290,7 +296,8 @@ SectionKind TargetLoweringObjectFile::getKindForGlobal(const GlobalObject *GO, // consideration when it tries to merge entries in the section. Reloc::Model ReloModel = TM.getRelocationModel(); if (ReloModel == Reloc::Static || ReloModel == Reloc::ROPI || - ReloModel == Reloc::RWPI || ReloModel == Reloc::ROPI_RWPI) + ReloModel == Reloc::RWPI || ReloModel == Reloc::ROPI_RWPI || + !C->needsDynamicRelocation()) return SectionKind::getReadOnly(); // Otherwise, the dynamic linker needs to fix it up, put it in the @@ -380,6 +387,11 @@ MCSection *TargetLoweringObjectFile::getSectionForMachineBasicBlock( return nullptr; } +MCSection *TargetLoweringObjectFile::getUniqueSectionForFunction( + const Function &F, const TargetMachine &TM) const { + return nullptr; +} + /// getTTypeGlobalReference - Return an MCExpr to use for a /// reference to the specified global variable from exception /// handling information. |