Removed small section flag for mips, the assembler doesnt support this flag
authorBruno Cardoso Lopes <bruno.cardoso@gmail.com>
Wed, 30 Jul 2008 17:04:04 +0000 (17:04 +0000)
committerBruno Cardoso Lopes <bruno.cardoso@gmail.com>
Wed, 30 Jul 2008 17:04:04 +0000 (17:04 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54214 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/Mips/MipsTargetAsmInfo.cpp
lib/Target/Mips/MipsTargetAsmInfo.h

index f8a14c66da12a742c5db0d8e570615737200278e..5c671cc24a34a18d691b29858f47e20473587590 100644 (file)
@@ -45,8 +45,16 @@ MipsTargetAsmInfo::MipsTargetAsmInfo(const MipsTargetMachine &TM):
 
 }
 
-SectionKind::Kind
-MipsTargetAsmInfo::SectionKindForGlobal(const GlobalValue *GV) const {
+unsigned MipsTargetAsmInfo::
+SectionFlagsForGlobal(const GlobalValue *GV, const char* Name) const {
+  unsigned Flags = ELFTargetAsmInfo::SectionFlagsForGlobal(GV, Name);
+  // Mask out Small Section flag bit, Mips doesnt support 's' section symbol
+  // for its small sections.
+  return (Flags & (~SectionFlags::Small));
+}
+
+SectionKind::Kind MipsTargetAsmInfo::
+SectionKindForGlobal(const GlobalValue *GV) const {
   SectionKind::Kind K = ELFTargetAsmInfo::SectionKindForGlobal(GV);
 
   if (Subtarget->hasABICall())
@@ -72,8 +80,8 @@ MipsTargetAsmInfo::SectionKindForGlobal(const GlobalValue *GV) const {
   return K;
 }
 
-const Section*
-MipsTargetAsmInfo::SelectSectionForGlobal(const GlobalValue *GV) const {
+const Section* MipsTargetAsmInfo::
+SelectSectionForGlobal(const GlobalValue *GV) const {
   SectionKind::Kind K = SectionKindForGlobal(GV);
   const GlobalVariable *GVA = dyn_cast<GlobalVariable>(GV);
 
index c798ae2a37380480b721bd2bfa1536ea9f2053b8..0511cca4551e60aed84d691d7b89f8659bf5ed83 100644 (file)
@@ -34,6 +34,12 @@ namespace llvm {
     virtual SectionKind::Kind
     SectionKindForGlobal(const GlobalValue *GV) const;
 
+    /// SectionFlagsForGlobal - This hook allows the target to select proper
+    /// section flags either for given global or for section.
+    virtual unsigned
+    SectionFlagsForGlobal(const GlobalValue *GV = NULL,
+                          const char* name = NULL) const;
+
     virtual const Section* SelectSectionForGlobal(const GlobalValue *GV) const;
 
     private: