aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2009-07-27 16:20:58 +0000
committerChris Lattner <sabre@nondot.org>2009-07-27 16:20:58 +0000
commit92ef3f66c19687a78d9e49a47958201d8abf9ee2 (patch)
tree6544f7df8739d314c7ea78e9b64092f296e73f40
parentc3ee7960d9485d20b790091def10c64ee7e75554 (diff)
sink text/data section creation down into the target-specific places that
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
-rw-r--r--lib/Target/DarwinTargetAsmInfo.cpp3
-rw-r--r--lib/Target/ELFTargetAsmInfo.cpp3
2 files changed, 5 insertions, 1 deletions
diff --git a/lib/Target/DarwinTargetAsmInfo.cpp b/lib/Target/DarwinTargetAsmInfo.cpp
index 244b689a55..5429e65926 100644
--- a/lib/Target/DarwinTargetAsmInfo.cpp
+++ b/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/lib/Target/ELFTargetAsmInfo.cpp b/lib/Target/ELFTargetAsmInfo.cpp
index de0150fdf9..391e348ba2 100644
--- a/lib/Target/ELFTargetAsmInfo.cpp
+++ b/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 =