diff --git a/llvm/lib/Target/DarwinTargetAsmInfo.cpp b/llvm/lib/Target/DarwinTargetAsmInfo.cpp index 244b689a552e..5429e6592680 100644 --- a/llvm/lib/Target/DarwinTargetAsmInfo.cpp +++ b/llvm/lib/Target/DarwinTargetAsmInfo.cpp @@ -27,6 +27,8 @@ using namespace llvm; DarwinTargetAsmInfo::DarwinTargetAsmInfo(const TargetMachine &TM) : TargetAsmInfo(TM) { + TextSection = getOrCreateSection("\t.text", true, SectionKind::Text); + DataSection = getOrCreateSection("\t.data", true, SectionKind::DataRel); CStringSection_ = getOrCreateSection("\t.cstring", true, SectionKind::MergeableCString); @@ -50,7 +52,6 @@ DarwinTargetAsmInfo::DarwinTargetAsmInfo(const TargetMachine &TM) SectionKind::ReadOnlyWithRel); DataCoalSection = getOrCreateSection("\t__DATA,__datacoal_nt,coalesced", false, SectionKind::DataRel); - // Common settings for all Darwin targets. // Syntax: diff --git a/llvm/lib/Target/ELFTargetAsmInfo.cpp b/llvm/lib/Target/ELFTargetAsmInfo.cpp index de0150fdf9d3..391e348ba21a 100644 --- a/llvm/lib/Target/ELFTargetAsmInfo.cpp +++ b/llvm/lib/Target/ELFTargetAsmInfo.cpp @@ -26,6 +26,9 @@ using namespace llvm; ELFTargetAsmInfo::ELFTargetAsmInfo(const TargetMachine &TM) : TargetAsmInfo(TM) { + + TextSection = getOrCreateSection("\t.text", true, SectionKind::Text); + DataSection = getOrCreateSection("\t.data", true, SectionKind::DataRel); ReadOnlySection = getOrCreateSection("\t.rodata", false, SectionKind::ReadOnly); TLSDataSection =