diff options
-rw-r--r-- | lib/Target/ELFTargetAsmInfo.cpp | 12 | ||||
-rw-r--r-- | test/CodeGen/ARM/section.ll | 2 |
2 files changed, 10 insertions, 4 deletions
diff --git a/lib/Target/ELFTargetAsmInfo.cpp b/lib/Target/ELFTargetAsmInfo.cpp index 19e5b01194..82ac847e84 100644 --- a/lib/Target/ELFTargetAsmInfo.cpp +++ b/lib/Target/ELFTargetAsmInfo.cpp @@ -166,13 +166,19 @@ std::string ELFTargetAsmInfo::PrintSectionFlags(unsigned flags) const { if (flags & SectionFlags::Small) Flags += 's'; - Flags += "\""; + Flags += "\","; + + // If comment string is '@', e.g. as on ARM - use '%' instead + if (strcmp(CommentString, "@") == 0) + Flags += '%'; + else + Flags += '@'; // FIXME: There can be exceptions here if (flags & SectionFlags::BSS) - Flags += ",@nobits"; + Flags += "nobits"; else - Flags += ",@progbits"; + Flags += "progbits"; if (unsigned entitySize = SectionFlags::getEntitySize(flags)) Flags += "," + utostr(entitySize); diff --git a/test/CodeGen/ARM/section.ll b/test/CodeGen/ARM/section.ll index 0397bcc36e..aa65845167 100644 --- a/test/CodeGen/ARM/section.ll +++ b/test/CodeGen/ARM/section.ll @@ -1,7 +1,7 @@ ; RUN: llvm-as < %s | llc -mtriple=arm-linux | \ ; RUN: grep {__DTOR_END__:} ; RUN: llvm-as < %s | llc -mtriple=arm-linux | \ -; RUN: grep {.section .dtors,"aw",.progbits} +; RUN: grep {\\.section.\\.dtors,"aw",.progbits} @__DTOR_END__ = internal global [1 x i32] zeroinitializer, section ".dtors" ; <[1 x i32]*> [#uses=0] |