diff options
Diffstat (limited to 'llvm/lib/CodeGen')
-rw-r--r-- | llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp | 9 | ||||
-rw-r--r-- | llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp | 8 |
2 files changed, 5 insertions, 12 deletions
diff --git a/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp b/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp index fabae38950f..9ffd830a9f5 100644 --- a/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp +++ b/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp @@ -355,12 +355,7 @@ static MCSymbol *getOrCreateEmuTLSInitSym(MCSymbol *GVSym, MCContext &C) { void AsmPrinter::EmitEmulatedTLSControlVariable(const GlobalVariable *GV, MCSymbol *EmittedSym, bool AllZeroInitValue) { - // If there is init value, use .data.rel.local section; - // otherwise use the .data section. - MCSection *TLSVarSection = - const_cast<MCSection *>((GV->hasInitializer() && !AllZeroInitValue) - ? getObjFileLowering().getDataRelSection() - : getObjFileLowering().getDataSection()); + MCSection *TLSVarSection = getObjFileLowering().getDataSection(); OutStreamer->SwitchSection(TLSVarSection); MCSymbol *GVSym = getSymbol(GV); EmitLinkage(GV, EmittedSym); // same linkage as GV @@ -1139,7 +1134,7 @@ bool AsmPrinter::doFinalization(Module &M) { // Output stubs for external and common global variables. MachineModuleInfoELF::SymbolListTy Stubs = MMIELF.GetGVStubList(); if (!Stubs.empty()) { - OutStreamer->SwitchSection(TLOF.getDataRelSection()); + OutStreamer->SwitchSection(TLOF.getDataSection()); const DataLayout &DL = M.getDataLayout(); for (const auto &Stub : Stubs) { diff --git a/llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp b/llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp index 7043f7911a3..58ae9cc53bd 100644 --- a/llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp +++ b/llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp @@ -233,10 +233,8 @@ static StringRef getSectionPrefixForGlobal(SectionKind Kind) { return ".tdata"; if (Kind.isThreadBSS()) return ".tbss"; - if (Kind.isDataNoRel()) + if (Kind.isData()) return ".data"; - if (Kind.isDataRel()) - return ".data.rel"; assert(Kind.isReadOnlyWithRel() && "Unknown section kind"); return ".data.rel.ro"; } @@ -502,7 +500,7 @@ emitModuleFlags(MCStreamer &Streamer, // Get the section. MCSectionMachO *S = getContext().getMachOSection( - Segment, Section, TAA, StubSize, SectionKind::getDataNoRel()); + Segment, Section, TAA, StubSize, SectionKind::getData()); Streamer.SwitchSection(S); Streamer.EmitLabel(getContext(). getOrCreateSymbol(StringRef("L_OBJC_IMAGE_INFO"))); @@ -635,7 +633,7 @@ MCSection *TargetLoweringObjectFileMachO::getSectionForConstant( const DataLayout &DL, SectionKind Kind, const Constant *C) const { // If this constant requires a relocation, we have to put it in the data // segment, not in the text segment. - if (Kind.isDataRel() || Kind.isReadOnlyWithRel()) + if (Kind.isData() || Kind.isReadOnlyWithRel()) return ConstDataSection; if (Kind.isMergeableConst4()) |