From ff4bc460c52c1f285d8a56da173641bf92d49e3f Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Mon, 10 Aug 2009 01:39:42 +0000 Subject: 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 --- lib/Target/X86/AsmPrinter/X86ATTAsmPrinter.cpp | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'lib/Target/X86/AsmPrinter') diff --git a/lib/Target/X86/AsmPrinter/X86ATTAsmPrinter.cpp b/lib/Target/X86/AsmPrinter/X86ATTAsmPrinter.cpp index 59cff0f..ae0e599 100644 --- a/lib/Target/X86/AsmPrinter/X86ATTAsmPrinter.cpp +++ b/lib/Target/X86/AsmPrinter/X86ATTAsmPrinter.cpp @@ -918,9 +918,11 @@ bool X86ATTAsmPrinter::doFinalization(Module &M) { // Output stubs for dynamically-linked functions if (!FnStubs.empty()) { const MCSection *TheSection = - TLOFMacho.getMachOSection("\t.section __IMPORT,__jump_table,symbol_stubs," - "self_modifying_code+pure_instructions,5", true, - SectionKind::getMetadata()); + TLOFMacho.getMachOSection("__IMPORT", "__jump_table", + MCSectionMachO::S_SYMBOL_STUBS | + MCSectionMachO::S_ATTR_SELF_MODIFYING_CODE | + MCSectionMachO::S_ATTR_PURE_INSTRUCTIONS, + 5, SectionKind::getMetadata()); SwitchToSection(TheSection); for (StringMap::iterator I = FnStubs.begin(), E = FnStubs.end(); I != E; ++I) @@ -932,8 +934,8 @@ bool X86ATTAsmPrinter::doFinalization(Module &M) { // Output stubs for external and common global variables. if (!GVStubs.empty()) { const MCSection *TheSection = - TLOFMacho.getMachOSection("\t.section __IMPORT,__pointers," - "non_lazy_symbol_pointers", true, + TLOFMacho.getMachOSection("__IMPORT", "__pointers", + MCSectionMachO::S_NON_LAZY_SYMBOL_POINTERS, SectionKind::getMetadata()); SwitchToSection(TheSection); for (StringMap::iterator I = GVStubs.begin(), -- cgit v1.1