[llvm] 9fbe16e - [CSKY] Fix .bss directive compling error created by --save-temps

Zi Xuan Wu via llvm-commits llvm-commits at lists.llvm.org
Tue Nov 1 23:18:51 PDT 2022


Author: Zi Xuan Wu (Zeson)
Date: 2022-11-02T14:18:35+08:00
New Revision: 9fbe16ee18a3e4639f0e6dadb01ab03dedbb99fb

URL: https://github.com/llvm/llvm-project/commit/9fbe16ee18a3e4639f0e6dadb01ab03dedbb99fb
DIFF: https://github.com/llvm/llvm-project/commit/9fbe16ee18a3e4639f0e6dadb01ab03dedbb99fb.diff

LOG: [CSKY] Fix .bss directive compling error created by --save-temps

.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.

Added: 
    

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

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Target/CSKY/MCTargetDesc/CSKYMCAsmInfo.cpp b/llvm/lib/Target/CSKY/MCTargetDesc/CSKYMCAsmInfo.cpp
index 543f2e3d43d4d..e8576d371bc65 100644
--- a/llvm/lib/Target/CSKY/MCTargetDesc/CSKYMCAsmInfo.cpp
+++ b/llvm/lib/Target/CSKY/MCTargetDesc/CSKYMCAsmInfo.cpp
@@ -23,5 +23,8 @@ CSKYMCAsmInfo::CSKYMCAsmInfo(const Triple &TargetTriple) {
   SupportsDebugInformation = true;
   CommentString = "#";
 
+  // Uses '.section' before '.bss' directive
+  UsesELFSectionDirectiveForBSS = true;
+
   ExceptionsType = ExceptionHandling::DwarfCFI;
 }


        


More information about the llvm-commits mailing list