Tie small stuff to non-small by default on ELF platforms
authorAnton Korobeynikov <asl@math.spbu.ru>
Tue, 22 Jul 2008 17:09:41 +0000 (17:09 +0000)
committerAnton Korobeynikov <asl@math.spbu.ru>
Tue, 22 Jul 2008 17:09:41 +0000 (17:09 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53919 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/Target/TargetAsmInfo.h
lib/Target/ELFTargetAsmInfo.cpp

index 98247e8d8017da78e03038e6651fd4ce9bffe933..852e03a3791588d11fbd9af1553ea60d98e71169 100644 (file)
@@ -40,8 +40,8 @@ namespace llvm {
       RODataMergeStr,   ///< Readonly data section (mergeable strings)
       RODataMergeConst, ///< Readonly data section (mergeable constants)
       SmallData,        ///< Small data section
-      SmallBSS,         ///< Small bss section     
-      SmallROData,      ///< Small readonly section     
+      SmallBSS,         ///< Small bss section
+      SmallROData,      ///< Small readonly section
       ThreadData,       ///< Initialized TLS data objects
       ThreadBSS         ///< Uninitialized TLS data objects
     };
@@ -58,6 +58,7 @@ namespace llvm {
     const unsigned TLS        = 1 << 5;  ///< Section contains thread-local data
     const unsigned Debug      = 1 << 6;  ///< Section contains debug data
     const unsigned Linkonce   = 1 << 7;  ///< Section is linkonce
+    const unsigned Small      = 1 << 8;  ///< Section is small
     const unsigned TypeFlags  = 0xFF;
     // Some gap for future flags
     const unsigned Named      = 1 << 23; ///< Section is named
index eb3608dcaa5d4776e52572730bc8054841990499..6ce01a836b400f1760a0d76d17c0089f99ef903d 100644 (file)
@@ -63,11 +63,14 @@ ELFTargetAsmInfo::SelectSectionForGlobal(const GlobalValue *GV) const {
     } else {
       switch (Kind) {
        case SectionKind::Data:
+       case SectionKind::SmallData:
         return getDataSection_();
        case SectionKind::BSS:
+       case SectionKind::SmallBSS:
         // ELF targets usually have BSS sections
         return getBSSSection_();
        case SectionKind::ROData:
+       case SectionKind::SmallROData:
         return getReadOnlySection_();
        case SectionKind::RODataMergeStr:
         return MergeableStringSection(GVar);
@@ -147,6 +150,8 @@ std::string ELFTargetAsmInfo::PrintSectionFlags(unsigned flags) const {
     Flags += 'S';
   if (flags & SectionFlags::TLS)
     Flags += 'T';
+  if (flags & SectionFlags::Small)
+    Flags += 's';
 
   Flags += "\"";