diff options
| author | Chris Lattner <sabre@nondot.org> | 2010-01-19 04:15:51 +0000 |
|---|---|---|
| committer | Chris Lattner <sabre@nondot.org> | 2010-01-19 04:15:51 +0000 |
| commit | ce8749e445fdd0493758932874bad50293647df9 (patch) | |
| tree | d0d640044545f6d9c22f1083dd19324110282999 /lib/Target/TargetLoweringObjectFile.cpp | |
| parent | 56b1319fbe18e886f7cff415b45df404fac39623 (diff) | |
make TLOF subclassify BSS based on linkage type into private, external
and everything else (weak).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93846 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/TargetLoweringObjectFile.cpp')
| -rw-r--r-- | lib/Target/TargetLoweringObjectFile.cpp | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/lib/Target/TargetLoweringObjectFile.cpp b/lib/Target/TargetLoweringObjectFile.cpp index 7b00b332f6..77203e0838 100644 --- a/lib/Target/TargetLoweringObjectFile.cpp +++ b/lib/Target/TargetLoweringObjectFile.cpp @@ -146,8 +146,13 @@ SectionKind TargetLoweringObjectFile::getKindForGlobal(const GlobalValue *GV, return SectionKind::getCommon(); // Variable can be easily put to BSS section. - if (isSuitableForBSS(GVar)) + if (isSuitableForBSS(GVar)) { + if (GVar->hasLocalLinkage()) + return SectionKind::getBSSLocal(); + else if (GVar->hasExternalLinkage()) + return SectionKind::getBSSExtern(); return SectionKind::getBSS(); + } Constant *C = GVar->getInitializer(); @@ -926,7 +931,7 @@ SelectSectionForGlobal(const GlobalValue *GV, SectionKind Kind, // Put zero initialized globals with strong external linkage in the // DATA, __common section with the .zerofill directive. - if (Kind.isBSS() && GV->hasExternalLinkage()) + if (Kind.isBSSExtern()) return DataCommonSection; // Otherwise, just drop the variable in the normal data section. |
