aboutsummaryrefslogtreecommitdiffstats
path: root/lib/Target/ARM
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2009-08-10 01:39:42 +0000
committerChris Lattner <sabre@nondot.org>2009-08-10 01:39:42 +0000
commit72a676aa4aa35b3eef2ac29b5bb79b4f941c1948 (patch)
tree7da0d5977dffaffaa4bb5da91039d0960f839f77 /lib/Target/ARM
parent8dd5e59a5074ca48140a04d9a0d16c71c02b8608 (diff)
downloadexternal_llvm-72a676aa4aa35b3eef2ac29b5bb79b4f941c1948.zip
external_llvm-72a676aa4aa35b3eef2ac29b5bb79b4f941c1948.tar.gz
external_llvm-72a676aa4aa35b3eef2ac29b5bb79b4f941c1948.tar.bz2
Make the big switch: Change MCSectionMachO to represent a section *semantically*
instead of syntactically as a string. This means that it keeps track of the segment, section, flags, etc directly and asmprints them in the right format. This also includes parsing and validation support for llvm-mc and "attribute(section)", so we should now start getting errors about invalid section attributes from the compiler instead of the assembler on darwin. Still todo: 1) Uniquing of darwin mcsections 2) Move all the Darwin stuff out to MCSectionMachO.[cpp|h] 3) there are a few FIXMEs, for example what is the syntax to get the S_GB_ZEROFILL segment type? git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78547 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/ARM')
-rw-r--r--lib/Target/ARM/AsmPrinter/ARMAsmPrinter.cpp29
1 files changed, 15 insertions, 14 deletions
diff --git a/lib/Target/ARM/AsmPrinter/ARMAsmPrinter.cpp b/lib/Target/ARM/AsmPrinter/ARMAsmPrinter.cpp
index ca61d55..9f79938 100644
--- a/lib/Target/ARM/AsmPrinter/ARMAsmPrinter.cpp
+++ b/lib/Target/ARM/AsmPrinter/ARMAsmPrinter.cpp
@@ -1286,19 +1286,21 @@ bool ARMAsmPrinter::doFinalization(Module &M) {
O << '\n';
if (!FnStubs.empty()) {
- const MCSection *StubSection;
- if (TM.getRelocationModel() == Reloc::PIC_)
- StubSection = TLOFMacho.getMachOSection(".section __TEXT,__picsymbolstu"
- "b4,symbol_stubs,none,16", true,
- SectionKind::getText());
- else
- StubSection = TLOFMacho.getMachOSection(".section __TEXT,__symbol_stub4"
- ",symbol_stubs,none,12", true,
- SectionKind::getText());
+ unsigned StubSize = 12;
+ const char *StubSectionName = "__symbol_stub4";
+
+ if (TM.getRelocationModel() == Reloc::PIC_) {
+ StubSize = 16;
+ StubSectionName = "__picsymbolstub4";
+ }
+
+ const MCSection *StubSection
+ = TLOFMacho.getMachOSection("__TEXT", StubSectionName,
+ MCSectionMachO::S_SYMBOL_STUBS,
+ StubSize, SectionKind::getText());
const MCSection *LazySymbolPointerSection
- = TLOFMacho.getMachOSection(".lazy_symbol_pointer", true,
- SectionKind::getMetadata());
+ = TLOFMacho.getLazySymbolPointerSection();
// Output stubs for dynamically-linked functions
for (StringMap<FnStubInfo>::iterator I = FnStubs.begin(),
@@ -1333,9 +1335,8 @@ bool ARMAsmPrinter::doFinalization(Module &M) {
// Output non-lazy-pointers for external and common global variables.
if (!GVNonLazyPtrs.empty()) {
- SwitchToSection(TLOFMacho.getMachOSection(".non_lazy_symbol_pointer",
- true,
- SectionKind::getMetadata()));
+ // Switch with ".non_lazy_symbol_pointer" directive.
+ SwitchToSection(TLOFMacho.getNonLazySymbolPointerSection());
for (StringMap<std::string>::iterator I = GVNonLazyPtrs.begin(),
E = GVNonLazyPtrs.end(); I != E; ++I) {
O << I->second << ":\n";