Add a method to return if the ELF section contains only common symbols!
authorBruno Cardoso Lopes <bruno.cardoso@gmail.com>
Thu, 13 Aug 2009 21:08:56 +0000 (21:08 +0000)
committerBruno Cardoso Lopes <bruno.cardoso@gmail.com>
Thu, 13 Aug 2009 21:08:56 +0000 (21:08 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78937 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/MC/MCSectionELF.h
lib/MC/MCSectionELF.cpp

index 00369f7d2f6b5c4a7e294bb94f39abb62d54a780..31e1e6684f60d5f4edc387fe11f96236840b4a2f 100644 (file)
@@ -55,6 +55,9 @@ public:
 
   /// ShouldPrintSectionType - Only prints the section type if supported
   bool ShouldPrintSectionType(unsigned Ty) const;
+
+  /// IsCommon - True if this section contains only common symbols
+  bool IsCommon() const;
   
   /// These are the section type and flags fields.  An ELF section can have
   /// only one Type, but can have more than one of the flags specified.
index d172a9c923026313d7411f5eee4fe047333129ee..56f803496ace65d59509516d9f30499a0892f757 100644 (file)
@@ -121,3 +121,13 @@ void MCSectionELF::PrintSwitchToSection(const TargetAsmInfo &TAI,
   OS << '\n';
 }
 
+// IsCommon - True if this section contains only common symbols
+bool MCSectionELF::IsCommon() const {
+  
+  if (strncmp(SectionName.c_str(), ".gnu.linkonce.", 14) == 0)
+    return true;
+
+  return false;
+}
+
+