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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77196 91177308-0d34-0410-b5e6-96231b3b80d8

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

index 244b689a552e377cc8714733b70cd357497d0b60..5429e659268020f625637a4d46981a6de658f13b 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 de0150fdf9d3f6327a9439de7049e2d2aea8fa45..391e348ba21a6a3e6c06520dcaaad8285de2cf48 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 =