LLVM API Documentation

llvm::MCSectionMachO Class Reference

#include <MCSectionMachO.h>

Inheritance diagram for llvm::MCSectionMachO:
[legend]
Collaboration diagram for llvm::MCSectionMachO:
[legend]

List of all members.

Public Types

enum  {
  SECTION_TYPE = 0x000000FFU, SECTION_ATTRIBUTES = 0xFFFFFF00U, S_REGULAR = 0x00U, S_ZEROFILL = 0x01U,
  S_CSTRING_LITERALS = 0x02U, S_4BYTE_LITERALS = 0x03U, S_8BYTE_LITERALS = 0x04U, S_LITERAL_POINTERS = 0x05U,
  S_NON_LAZY_SYMBOL_POINTERS = 0x06U, S_LAZY_SYMBOL_POINTERS = 0x07U, S_SYMBOL_STUBS = 0x08U, S_MOD_INIT_FUNC_POINTERS = 0x09U,
  S_MOD_TERM_FUNC_POINTERS = 0x0AU, S_COALESCED = 0x0BU, S_GB_ZEROFILL = 0x0CU, S_INTERPOSING = 0x0DU,
  S_16BYTE_LITERALS = 0x0EU, S_DTRACE_DOF = 0x0FU, S_LAZY_DYLIB_SYMBOL_POINTERS = 0x10U, LAST_KNOWN_SECTION_TYPE = S_LAZY_DYLIB_SYMBOL_POINTERS,
  S_ATTR_PURE_INSTRUCTIONS = 1U << 31, S_ATTR_NO_TOC = 1U << 30, S_ATTR_STRIP_STATIC_SYMS = 1U << 29, S_ATTR_NO_DEAD_STRIP = 1U << 28,
  S_ATTR_LIVE_SUPPORT = 1U << 27, S_ATTR_SELF_MODIFYING_CODE = 1U << 26, S_ATTR_DEBUG = 1U << 25, S_ATTR_SOME_INSTRUCTIONS = 1U << 10,
  S_ATTR_EXT_RELOC = 1U << 9, S_ATTR_LOC_RELOC = 1U << 8
}

Public Member Functions

StringRef getSegmentName () const
StringRef getSectionName () const
unsigned getTypeAndAttributes () const
unsigned getStubSize () const
virtual void PrintSwitchToSection (const TargetAsmInfo &TAI, raw_ostream &OS) const

Static Public Member Functions

static MCSectionMachO * Create (const StringRef &Segment, const StringRef &Section, unsigned TypeAndAttributes, unsigned Reserved2, SectionKind K, MCContext &Ctx)
static std::string ParseSectionSpecifier (StringRef Spec, StringRef &Segment, StringRef &Section, unsigned &TAA, unsigned &StubSize)


Detailed Description

MCSectionMachO - This represents a section on a Mach-O system (used by Mac OS X). On a Mac system, these are also described in /usr/include/mach-o/loader.h.

Definition at line 24 of file MCSectionMachO.h.


Member Enumeration Documentation

anonymous enum

These are the section type and attributes fields. A MachO section can have only one Type, but can have any of the attributes specified.

Enumerator:
SECTION_TYPE 
SECTION_ATTRIBUTES 
S_REGULAR  S_REGULAR - Regular section.
S_ZEROFILL  S_ZEROFILL - Zero fill on demand section.
S_CSTRING_LITERALS  S_CSTRING_LITERALS - Section with literal C strings.
S_4BYTE_LITERALS  S_4BYTE_LITERALS - Section with 4 byte literals.
S_8BYTE_LITERALS  S_8BYTE_LITERALS - Section with 8 byte literals.
S_LITERAL_POINTERS  S_LITERAL_POINTERS - Section with pointers to literals.
S_NON_LAZY_SYMBOL_POINTERS  S_NON_LAZY_SYMBOL_POINTERS - Section with non-lazy symbol pointers.
S_LAZY_SYMBOL_POINTERS  S_LAZY_SYMBOL_POINTERS - Section with lazy symbol pointers.
S_SYMBOL_STUBS  S_SYMBOL_STUBS - Section with symbol stubs, byte size of stub in the Reserved2 field.
S_MOD_INIT_FUNC_POINTERS  S_SYMBOL_STUBS - Section with only function pointers for initialization.
S_MOD_TERM_FUNC_POINTERS  S_MOD_INIT_FUNC_POINTERS - Section with only function pointers for termination.
S_COALESCED  S_COALESCED - Section contains symbols that are to be coalesced.
S_GB_ZEROFILL  S_GB_ZEROFILL - Zero fill on demand section (that can be larger than 4 gigabytes).
S_INTERPOSING  S_INTERPOSING - Section with only pairs of function pointers for interposing.
S_16BYTE_LITERALS  S_16BYTE_LITERALS - Section with only 16 byte literals.
S_DTRACE_DOF  S_DTRACE_DOF - Section contains DTrace Object Format.
S_LAZY_DYLIB_SYMBOL_POINTERS  S_LAZY_DYLIB_SYMBOL_POINTERS - Section with lazy symbol pointers to lazy loaded dylibs.
LAST_KNOWN_SECTION_TYPE 
S_ATTR_PURE_INSTRUCTIONS  S_ATTR_PURE_INSTRUCTIONS - Section contains only true machine instructions.
S_ATTR_NO_TOC  S_ATTR_NO_TOC - Section contains coalesced symbols that are not to be in a ranlib table of contents.
S_ATTR_STRIP_STATIC_SYMS  S_ATTR_STRIP_STATIC_SYMS - Ok to strip static symbols in this section in files with the MY_DYLDLINK flag.
S_ATTR_NO_DEAD_STRIP  S_ATTR_NO_DEAD_STRIP - No dead stripping.
S_ATTR_LIVE_SUPPORT  S_ATTR_LIVE_SUPPORT - Blocks are live if they reference live blocks.
S_ATTR_SELF_MODIFYING_CODE  S_ATTR_SELF_MODIFYING_CODE - Used with i386 code stubs written on by dyld.
S_ATTR_DEBUG  S_ATTR_DEBUG - A debug section.
S_ATTR_SOME_INSTRUCTIONS  S_ATTR_SOME_INSTRUCTIONS - Section contains some machine instructions.
S_ATTR_EXT_RELOC  S_ATTR_EXT_RELOC - Section has external relocation entries.
S_ATTR_LOC_RELOC  S_ATTR_LOC_RELOC - Section has local relocation entries.

Definition at line 63 of file MCSectionMachO.h.


Member Function Documentation

MCSectionMachO * MCSectionMachO::Create ( const StringRef &  Segment,
const StringRef &  Section,
unsigned  TypeAndAttributes,
unsigned  Reserved2,
SectionKind  K,
MCContext &  Ctx 
) [static]

StringRef llvm::MCSectionMachO::getSegmentName (  )  const [inline]

Definition at line 142 of file MCSectionMachO.h.

Referenced by PrintSwitchToSection().

StringRef llvm::MCSectionMachO::getSectionName (  )  const [inline]

Definition at line 148 of file MCSectionMachO.h.

Referenced by PrintSwitchToSection().

unsigned llvm::MCSectionMachO::getTypeAndAttributes (  )  const [inline]

unsigned llvm::MCSectionMachO::getStubSize (  )  const [inline]

std::string MCSectionMachO::ParseSectionSpecifier ( StringRef  Spec,
StringRef &  Segment,
StringRef &  Section,
unsigned &  TAA,
unsigned &  StubSize 
) [static]

ParseSectionSpecifier - Parse the section specifier indicated by "Spec". This is a string that can appear after a .section directive in a mach-o flavored .s file. If successful, this fills in the specified Out parameters and returns an empty string. When an invalid section specifier is present, this returns a string indicating the problem.

ParseSectionSpecifier - Parse the section specifier indicated by "Spec". This is a string that can appear after a .section directive in a mach-o flavored .s file. If successful, this fills in the specified Out parameters and returns an empty string. When an invalid section specifier is present, this returns a string indicating the problem.

Definition at line 147 of file MCSectionMachO.cpp.

References AssemblerName, AttrFlag, llvm::StringRef::data(), llvm::StringRef::empty(), LAST_KNOWN_SECTION_TYPE, llvm::Intrinsic::memcpy, S_SYMBOL_STUBS, SECTION_TYPE, SectionAttrDescriptors, SectionTypeDescriptors, llvm::StringRef::size(), llvm::StringRef::split(), and StripSpaces().

Referenced by llvm::TargetLoweringObjectFileMachO::getExplicitSectionGlobal().

void MCSectionMachO::PrintSwitchToSection ( const TargetAsmInfo &  TAI,
raw_ostream &  OS 
) const [virtual]


The documentation for this class was generated from the following files: