MC COFF: Emit the 'b' section flag for .bss sections in GNU assembly

Without this, assembling clang's disassembly would produce an object
file with the IMAGE_SCN_CNT_INITIALIZED_DATA section characteristic
rather than the uninitialized one.  link.exe would warn when merging
comdats with different flags.

llvm-svn: 197529
This commit is contained in:
Reid Kleckner 2013-12-17 22:12:40 +00:00
parent 2b8c8dce53
commit 7f077ea70a
2 changed files with 5 additions and 0 deletions

View File

@ -54,6 +54,8 @@ void MCSectionCOFF::PrintSwitchToSection(const MCAsmInfo &MAI,
OS << "\t.section\t" << getSectionName() << ",\"";
if (getKind().isText())
OS << 'x';
else if (getKind().isBSS())
OS << 'b';
if (getKind().isWriteable())
OS << 'w';
else

View File

@ -4,3 +4,6 @@
@"\01?thingy@@3Ufoo@@B" = global %struct.foo zeroinitializer, align 4
; CHECK: .bss
@thingy_linkonce = linkonce_odr global %struct.foo zeroinitializer, align 4
; CHECK: .section .bss,"bw",discard,_thingy_linkonce