diff options
| author | Chris Lattner <sabre@nondot.org> | 2009-07-26 03:06:11 +0000 |
|---|---|---|
| committer | Chris Lattner <sabre@nondot.org> | 2009-07-26 03:06:11 +0000 |
| commit | 8e58bc9ed47a290db076977fa40c25c1e0bc65b2 (patch) | |
| tree | e5532f30bd2c315df1a6cd79bccbd2f05e2ab86c /llvm/lib | |
| parent | 4aea2d97c8ffb5da89b24c536d813a7002d9363e (diff) | |
| download | bcm5719-llvm-8e58bc9ed47a290db076977fa40c25c1e0bc65b2.tar.gz bcm5719-llvm-8e58bc9ed47a290db076977fa40c25c1e0bc65b2.zip | |
put normal data into .data instead of .data.rel on elf systems.
llvm-svn: 77116
Diffstat (limited to 'llvm/lib')
| -rw-r--r-- | llvm/lib/Target/ELFTargetAsmInfo.cpp | 32 |
1 files changed, 11 insertions, 21 deletions
diff --git a/llvm/lib/Target/ELFTargetAsmInfo.cpp b/llvm/lib/Target/ELFTargetAsmInfo.cpp index da8ed73852b..880dfbc0a93 100644 --- a/llvm/lib/Target/ELFTargetAsmInfo.cpp +++ b/llvm/lib/Target/ELFTargetAsmInfo.cpp @@ -49,34 +49,24 @@ ELFTargetAsmInfo::ELFTargetAsmInfo(const TargetMachine &TM) const Section* ELFTargetAsmInfo::SelectSectionForGlobal(const GlobalValue *GV, SectionKind Kind) const { - if (isa<Function>(GV)) - return TextSection; - - const GlobalVariable *GVar = cast<GlobalVariable>(GV); switch (Kind.getKind()) { - default: llvm_unreachable("Unsuported section kind for global"); - case SectionKind::BSS: - return getBSSSection_(); - case SectionKind::Data: - case SectionKind::DataRel: - return DataRelSection; - case SectionKind::DataRelLocal: - return DataRelLocalSection; - case SectionKind::DataRelRO: - return DataRelROSection; - case SectionKind::DataRelROLocal: - return DataRelROLocalSection; - case SectionKind::ROData: - return getReadOnlySection(); + default: llvm_unreachable("Unknown section kind"); + case SectionKind::Text: return TextSection; + case SectionKind::BSS: return getBSSSection_(); + case SectionKind::Data: return DataSection; + case SectionKind::DataRel: return DataRelSection; + case SectionKind::DataRelLocal: return DataRelLocalSection; + case SectionKind::DataRelRO: return DataRelROSection; + case SectionKind::DataRelROLocal: return DataRelROLocalSection; + case SectionKind::ROData: return getReadOnlySection(); case SectionKind::RODataMergeStr: - return MergeableStringSection(GVar); + return MergeableStringSection(cast<GlobalVariable>(GV)); case SectionKind::RODataMergeConst: { - const Type *Ty = GVar->getInitializer()->getType(); + const Type *Ty = cast<GlobalVariable>(GV)->getInitializer()->getType(); const TargetData *TD = TM.getTargetData(); return getSectionForMergableConstant(TD->getTypeAllocSize(Ty), 0); } case SectionKind::ThreadData: - // ELF targets usually support TLS stuff return TLSDataSection; case SectionKind::ThreadBSS: return TLSBSSSection; |

