LLVM API Documentation
#include <MCSectionELF.h>
Public Types | |
| enum | { SHT_NULL = 0x00U, SHT_PROGBITS = 0x01U, SHT_SYMTAB = 0x02U, SHT_STRTAB = 0x03U, SHT_RELA = 0x04U, SHT_HASH = 0x05U, SHT_DYNAMIC = 0x06U, SHT_NOTE = 0x07U, SHT_NOBITS = 0x08U, SHT_REL = 0x09U, SHT_SHLIB = 0x0AU, SHT_DYNSYM = 0x0BU, SHT_INIT_ARRAY = 0x0EU, SHT_FINI_ARRAY = 0x0FU, SHT_PREINIT_ARRAY = 0x10U, SHT_GROUP = 0x11U, SHT_SYMTAB_SHNDX = 0x12U, LAST_KNOWN_SECTION_TYPE = SHT_SYMTAB_SHNDX } |
| enum | { SHF_WRITE = 0x1U, SHF_ALLOC = 0x2U, SHF_EXECINSTR = 0x4U, SHF_MERGE = 0x10U, SHF_STRINGS = 0x20U, SHF_INFO_LINK = 0x40U, SHF_LINK_ORDER = 0x80U, SHF_OS_NONCONFORMING = 0x100U, SHF_GROUP = 0x200U, SHF_TLS = 0x400U, FIRST_TARGET_DEP_FLAG = 0x800U, TARGET_INDEP_SHF = FIRST_TARGET_DEP_FLAG-1U } |
| Valid section flags. More... | |
Public Member Functions | |
| bool | ShouldOmitSectionDirective (const char *Name, const TargetAsmInfo &TAI) const |
| bool | ShouldPrintSectionType (unsigned Ty) const |
| ShouldPrintSectionType - Only prints the section type if supported. | |
| bool | HasCommonSymbols () const |
| StringRef | getSectionName () const |
| unsigned | getType () const |
| unsigned | getFlags () const |
| virtual void | PrintSwitchToSection (const TargetAsmInfo &TAI, raw_ostream &OS) const |
| virtual void | PrintTargetSpecificSectionFlags (const TargetAsmInfo &TAI, raw_ostream &OS) const |
Static Public Member Functions | |
| static MCSectionELF * | Create (const StringRef &Section, unsigned Type, unsigned Flags, SectionKind K, bool isExplicit, MCContext &Ctx) |
Protected Member Functions | |
| MCSectionELF (const StringRef &Section, unsigned type, unsigned flags, SectionKind K, bool isExplicit) | |
Definition at line 23 of file MCSectionELF.h.
| anonymous enum |
These are the section type and flags fields. An ELF section can have only one Type, but can have more than one of the flags specified.
Valid section types.
Definition at line 65 of file MCSectionELF.h.
| anonymous enum |
Valid section flags.
| SHF_WRITE | |
| SHF_ALLOC | |
| SHF_EXECINSTR | |
| SHF_MERGE | |
| SHF_STRINGS | |
| SHF_INFO_LINK | |
| SHF_LINK_ORDER | |
| SHF_OS_NONCONFORMING | |
| SHF_GROUP | |
| SHF_TLS | |
| FIRST_TARGET_DEP_FLAG | FIRST_TARGET_DEP_FLAG - This is the first flag that subclasses are allowed to specify. |
| TARGET_INDEP_SHF | TARGET_INDEP_SHF - This is the bitmask for all the target independent section flags. Targets can define their own target flags above these. If they do that, they should implement their own MCSectionELF subclasses and implement the virtual method hooks below to handle printing needs. |
Definition at line 124 of file MCSectionELF.h.
| llvm::MCSectionELF::MCSectionELF | ( | const StringRef & | Section, | |
| unsigned | type, | |||
| unsigned | flags, | |||
| SectionKind | K, | |||
| bool | isExplicit | |||
| ) | [inline, protected] |
| MCSectionELF * MCSectionELF::Create | ( | const StringRef & | Section, | |
| unsigned | Type, | |||
| unsigned | Flags, | |||
| SectionKind | K, | |||
| bool | isExplicit, | |||
| MCContext & | Ctx | |||
| ) | [static] |
Reimplemented in llvm::MCSectionXCore.
Definition at line 18 of file MCSectionELF.cpp.
References MCSectionELF().
Referenced by llvm::TargetLoweringObjectFileELF::getELFSection().
| bool MCSectionELF::ShouldOmitSectionDirective | ( | const char * | Name, | |
| const TargetAsmInfo & | TAI | |||
| ) | const |
ShouldOmitSectionDirective - Decides whether a '.section' directive should be printed before the section name
Definition at line 25 of file MCSectionELF.cpp.
References llvm::TargetAsmInfo::usesELFSectionDirectiveForBSS().
Referenced by PrintSwitchToSection().
ShouldPrintSectionType - Only prints the section type if supported.
Definition at line 39 of file MCSectionELF.cpp.
References SHT_NOBITS, and SHT_PROGBITS.
Referenced by PrintSwitchToSection().
| bool MCSectionELF::HasCommonSymbols | ( | ) | const |
HasCommonSymbols - True if this section holds common symbols, this is indicated on the ELF object file by a symbol with SHN_COMMON section header index.
Definition at line 130 of file MCSectionELF.cpp.
| StringRef llvm::MCSectionELF::getSectionName | ( | ) | const [inline] |
| unsigned llvm::MCSectionELF::getType | ( | ) | const [inline] |
Definition at line 171 of file MCSectionELF.h.
| unsigned llvm::MCSectionELF::getFlags | ( | ) | const [inline] |
Definition at line 172 of file MCSectionELF.h.
Referenced by llvm::MCSectionXCore::PrintTargetSpecificSectionFlags().
| void MCSectionELF::PrintSwitchToSection | ( | const TargetAsmInfo & | TAI, | |
| raw_ostream & | OS | |||
| ) | const [virtual] |
Implements llvm::MCSection.
Definition at line 47 of file MCSectionELF.cpp.
References llvm::TargetAsmInfo::getCommentString(), llvm::MCSection::getKind(), getSectionName(), llvm::SectionKind::isMergeable1ByteCString(), llvm::SectionKind::isMergeable2ByteCString(), llvm::SectionKind::isMergeable4ByteCString(), llvm::SectionKind::isMergeableConst16(), llvm::SectionKind::isMergeableConst4(), llvm::SectionKind::isMergeableConst8(), PrintTargetSpecificSectionFlags(), SHF_ALLOC, SHF_EXECINSTR, SHF_MERGE, SHF_STRINGS, SHF_TLS, SHF_WRITE, ShouldOmitSectionDirective(), ShouldPrintSectionType(), SHT_FINI_ARRAY, SHT_INIT_ARRAY, SHT_NOBITS, SHT_PREINIT_ARRAY, SHT_PROGBITS, TARGET_INDEP_SHF, and llvm::TargetAsmInfo::usesSunStyleELFSectionSwitchSyntax().
| virtual void llvm::MCSectionELF::PrintTargetSpecificSectionFlags | ( | const TargetAsmInfo & | TAI, | |
| raw_ostream & | OS | |||
| ) | const [inline, virtual] |
PrintTargetSpecificSectionFlags - Targets that define their own MCSectionELF subclasses with target specific section flags should implement this method if they end up adding letters to the attributes list.
Reimplemented in llvm::MCSectionXCore.
Definition at line 182 of file MCSectionELF.h.
Referenced by PrintSwitchToSection().