aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Target/TargetLoweringObjectFile.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2010-01-19 04:15:51 +0000
committerChris Lattner <sabre@nondot.org>2010-01-19 04:15:51 +0000
commitb253421711ee9094ab16d8c897b4a91b53366040 (patch)
tree57772be60f3142e2d9dded9f0aa5738bc5b38a29 /llvm/lib/Target/TargetLoweringObjectFile.cpp
parent70f0c33ec8f5bbee8296a8fe72e63517e8a041c4 (diff)
downloadllvm-b253421711ee9094ab16d8c897b4a91b53366040.zip
llvm-b253421711ee9094ab16d8c897b4a91b53366040.tar.gz
llvm-b253421711ee9094ab16d8c897b4a91b53366040.tar.bz2
make TLOF subclassify BSS based on linkage type into private, external
and everything else (weak). llvm-svn: 93846
Diffstat (limited to 'llvm/lib/Target/TargetLoweringObjectFile.cpp')
-rw-r--r--llvm/lib/Target/TargetLoweringObjectFile.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/llvm/lib/Target/TargetLoweringObjectFile.cpp b/llvm/lib/Target/TargetLoweringObjectFile.cpp
index 7b00b33..77203e0 100644
--- a/llvm/lib/Target/TargetLoweringObjectFile.cpp
+++ b/llvm/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.