[CSKY] Fix .bss directive compling error created by --save-temps
authorZi Xuan Wu (Zeson) <zixuan.wu@linux.alibaba.com>
Fri, 28 Oct 2022 02:26:32 +0000 (10:26 +0800)
committerZi Xuan Wu <zixuan.wu@linux.alibaba.com>
Wed, 2 Nov 2022 06:18:35 +0000 (14:18 +0800)
.bss without symbol and num following can't be compiled in CSKY target, which is consistent to GCC behavior.
So when --save-temps generates .bss, we should UsesELFSectionDirectiveForBSS to avoid such error.

llvm/lib/Target/CSKY/MCTargetDesc/CSKYMCAsmInfo.cpp

index 543f2e3..e8576d3 100644 (file)
@@ -23,5 +23,8 @@ CSKYMCAsmInfo::CSKYMCAsmInfo(const Triple &TargetTriple) {
   SupportsDebugInformation = true;
   CommentString = "#";
 
+  // Uses '.section' before '.bss' directive
+  UsesELFSectionDirectiveForBSS = true;
+
   ExceptionsType = ExceptionHandling::DwarfCFI;
 }