diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/CodeGen/TargetLoweringObjectFileImpl.cpp | 11 | ||||
-rw-r--r-- | lib/MC/MCObjectFileInfo.cpp | 6 |
2 files changed, 13 insertions, 4 deletions
diff --git a/lib/CodeGen/TargetLoweringObjectFileImpl.cpp b/lib/CodeGen/TargetLoweringObjectFileImpl.cpp index ea0d62e6ef..085e8f4018 100644 --- a/lib/CodeGen/TargetLoweringObjectFileImpl.cpp +++ b/lib/CodeGen/TargetLoweringObjectFileImpl.cpp @@ -771,15 +771,18 @@ SelectSectionForGlobal(const GlobalValue *GV, SectionKind Kind, } if (Kind.isText()) - return getTextSection(); + return TextSection; if (Kind.isThreadLocal()) - return getTLSDataSection(); + return TLSDataSection; - if (Kind.isReadOnly() && ReadOnlySection != 0) + if (Kind.isReadOnly()) return ReadOnlySection; - return getDataSection(); + if (Kind.isBSS()) + return BSSSection; + + return DataSection; } void TargetLoweringObjectFileCOFF:: diff --git a/lib/MC/MCObjectFileInfo.cpp b/lib/MC/MCObjectFileInfo.cpp index bcf52d2368..819c00b180 100644 --- a/lib/MC/MCObjectFileInfo.cpp +++ b/lib/MC/MCObjectFileInfo.cpp @@ -496,6 +496,12 @@ void MCObjectFileInfo::InitELFMCObjectFileInfo(Triple T) { void MCObjectFileInfo::InitCOFFMCObjectFileInfo(Triple T) { // COFF + BSSSection = + Ctx->getCOFFSection(".bss", + COFF::IMAGE_SCN_CNT_UNINITIALIZED_DATA | + COFF::IMAGE_SCN_MEM_READ | + COFF::IMAGE_SCN_MEM_WRITE, + SectionKind::getBSS()); TextSection = Ctx->getCOFFSection(".text", COFF::IMAGE_SCN_CNT_CODE | |