sink text/data section creation down into the target-specific places that
authorChris Lattner <sabre@nondot.org>
Mon, 27 Jul 2009 16:20:58 +0000 (16:20 +0000)
committerChris Lattner <sabre@nondot.org>
Mon, 27 Jul 2009 16:20:58 +0000 (16:20 +0000)
should know about them.  PECoff doesn't share these, and I want all sections
to be created by object-file-specific code.

llvm-svn: 77196

llvm/lib/Target/DarwinTargetAsmInfo.cpp
llvm/lib/Target/ELFTargetAsmInfo.cpp

index 244b689..5429e65 100644 (file)
@@ -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:
index de0150f..391e348 100644 (file)
@@ -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 =