aboutsummaryrefslogtreecommitdiff
path: root/lib/Target/ARM/AsmPrinter/ARMAsmPrinter.cpp
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
commitff4bc460c52c1f285d8a56da173641bf92d49e3f (patch)
tree7da0d5977dffaffaa4bb5da91039d0960f839f77 /lib/Target/ARM/AsmPrinter/ARMAsmPrinter.cpp
parente36df3fd31a08a41d9ad04fcba182b616b030c9c (diff)
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/AsmPrinter/ARMAsmPrinter.cpp')
-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 ca61d55b81..9f7993865d 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";