[llvm-commits] [llvm] r53920 - /llvm/trunk/lib/Target/TargetAsmInfo.cpp
Anton Korobeynikov
asl at math.spbu.ru
Tue Jul 22 10:10:00 PDT 2008
Author: asl
Date: Tue Jul 22 12:09:59 2008
New Revision: 53920
URL: http://llvm.org/viewvc/llvm-project?rev=53920&view=rev
Log:
Provide default implementation of different small-sections related stuff
Modified:
llvm/trunk/lib/Target/TargetAsmInfo.cpp
Modified: llvm/trunk/lib/Target/TargetAsmInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/TargetAsmInfo.cpp?rev=53920&r1=53919&r2=53920&view=diff
==============================================================================
--- llvm/trunk/lib/Target/TargetAsmInfo.cpp (original)
+++ llvm/trunk/lib/Target/TargetAsmInfo.cpp Tue Jul 22 12:09:59 2008
@@ -231,6 +231,13 @@
case SectionKind::RODataMergeConst:
// No additional flags here
break;
+ case SectionKind::SmallData:
+ case SectionKind::SmallBSS:
+ Flags |= SectionFlags::Writeable;
+ // FALLS THROUGH
+ case SectionKind::SmallROData:
+ Flags |= SectionFlags::Small;
+ break;
default:
assert(0 && "Unexpected section kind!");
}
@@ -245,7 +252,9 @@
// Some lame default implementation based on some magic section names.
if (strncmp(Name, ".gnu.linkonce.b.", 16) == 0 ||
- strncmp(Name, ".llvm.linkonce.b.", 17) == 0)
+ strncmp(Name, ".llvm.linkonce.b.", 17) == 0 ||
+ strncmp(Name, ".gnu.linkonce.sb.", 17) == 0 ||
+ strncmp(Name, ".llvm.linkonce.sb.", 18) == 0)
Flags |= SectionFlags::BSS;
else if (strcmp(Name, ".tdata") == 0 ||
strncmp(Name, ".tdata.", 7) == 0 ||
@@ -297,12 +306,15 @@
} else {
if (Kind == SectionKind::Text)
return getTextSection_();
- else if (Kind == SectionKind::BSS && getBSSSection_())
+ else if ((Kind == SectionKind::BSS ||
+ Kind == SectionKind::SmallBSS) &&
+ getBSSSection_())
return getBSSSection_();
else if (getReadOnlySection_() &&
(Kind == SectionKind::ROData ||
Kind == SectionKind::RODataMergeConst ||
- Kind == SectionKind::RODataMergeStr))
+ Kind == SectionKind::RODataMergeStr ||
+ Kind == SectionKind::SmallROData))
return getReadOnlySection_();
}
@@ -317,12 +329,18 @@
return ".gnu.linkonce.t." + GV->getName();
case SectionKind::Data:
return ".gnu.linkonce.d." + GV->getName();
+ case SectionKind::SmallData:
+ return ".gnu.linkonce.s." + GV->getName();
case SectionKind::BSS:
return ".gnu.linkonce.b." + GV->getName();
+ case SectionKind::SmallBSS:
+ return ".gnu.linkonce.sb." + GV->getName();
case SectionKind::ROData:
case SectionKind::RODataMergeConst:
case SectionKind::RODataMergeStr:
return ".gnu.linkonce.r." + GV->getName();
+ case SectionKind::SmallROData:
+ return ".gnu.linkonce.s2." + GV->getName();
case SectionKind::ThreadData:
return ".gnu.linkonce.td." + GV->getName();
case SectionKind::ThreadBSS:
More information about the llvm-commits
mailing list