diff options
author | Chris Lattner <sabre@nondot.org> | 2009-08-04 16:19:50 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2009-08-04 16:19:50 +0000 |
commit | eee9df0e9704432327df34bb12f96bf95a7315b5 (patch) | |
tree | 8ee76c5f5449a6606826668dfa60af9d2c1774e6 /llvm/lib/Target/TargetLoweringObjectFile.cpp | |
parent | 81bbf443fe473ad3f03e5e8ec8752fd3da2995a6 (diff) | |
download | llvm-eee9df0e9704432327df34bb12f96bf95a7315b5.zip llvm-eee9df0e9704432327df34bb12f96bf95a7315b5.tar.gz llvm-eee9df0e9704432327df34bb12f96bf95a7315b5.tar.bz2 |
fix a fixme: don't create an explicit "CStringSection" for ELF,
it is just being used as a prefix, so forward substitute it directly.
llvm-svn: 78067
Diffstat (limited to 'llvm/lib/Target/TargetLoweringObjectFile.cpp')
-rw-r--r-- | llvm/lib/Target/TargetLoweringObjectFile.cpp | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/llvm/lib/Target/TargetLoweringObjectFile.cpp b/llvm/lib/Target/TargetLoweringObjectFile.cpp index 7d8f529..730d32f 100644 --- a/llvm/lib/Target/TargetLoweringObjectFile.cpp +++ b/llvm/lib/Target/TargetLoweringObjectFile.cpp @@ -320,10 +320,6 @@ void TargetLoweringObjectFileELF::Initialize(MCContext &Ctx, TLSDataSection = getOrCreateSection("\t.tdata", false, SectionKind::getThreadData()); - // FIXME: No reason to make this. - CStringSection = getOrCreateSection("\t.rodata.str", true, - SectionKind::getMergeable1ByteCString()); - TLSBSSSection = getOrCreateSection("\t.tbss", false, SectionKind::getThreadBSS()); @@ -511,7 +507,6 @@ SelectSectionForGlobal(const GlobalValue *GV, SectionKind Kind, if (Kind.isMergeable1ByteCString() || Kind.isMergeable2ByteCString() || Kind.isMergeable4ByteCString()) { - assert(CStringSection && "Should have string section prefix"); // We also need alignment here. // FIXME: this is getting the alignment of the character, not the @@ -519,16 +514,16 @@ SelectSectionForGlobal(const GlobalValue *GV, SectionKind Kind, unsigned Align = TM.getTargetData()->getPreferredAlignment(cast<GlobalVariable>(GV)); - const char *SizeSpec = "1."; + const char *SizeSpec = ".rodata.str1."; if (Kind.isMergeable2ByteCString()) - SizeSpec = "2."; + SizeSpec = ".rodata.str2."; else if (Kind.isMergeable4ByteCString()) - SizeSpec = "4."; + SizeSpec = ".rodata.str4."; else assert(Kind.isMergeable1ByteCString() && "unknown string width"); - std::string Name = CStringSection->getName() + SizeSpec + utostr(Align); + std::string Name = SizeSpec + utostr(Align); return getOrCreateSection(Name.c_str(), false, Kind); } |