Go to the documentation of this file.
9 #ifndef LLVM_LIB_OBJCOPY_MACHO_MACHOOBJECT_H
10 #define LLVM_LIB_OBJCOPY_MACHO_MACHOOBJECT_H
99 std::vector<std::unique_ptr<Section>>
Sections;
140 std::vector<std::unique_ptr<SymbolEntry>>
Symbols;
197 assert(SymbolNum < (1 << 24) &&
"SymbolNum out of range");
374 #endif // LLVM_LIB_OBJCOPY_MACHO_MACHOOBJECT_H
Optional< size_t > SymTabCommandIndex
The index of LC_SYMTAB load command if present.
LLVM_NODISCARD bool startswith(StringRef Prefix) const
Check if this string starts with the given Prefix.
pointee_iterator< std::vector< std::unique_ptr< SymbolEntry > >::const_iterator > iterator
Optional< const SymbolEntry * > Symbol
StringSaver NewSectionsContents
This is an optimization pass for GlobalISel generic memory operations.
Optional< size_t > LinkerOptimizationHintCommandIndex
The index of LC_LINKER_OPTIMIZATIN_HINT load command if present.
unsigned getPlainRelocationSymbolNum(bool IsLittleEndian)
IndirectSymbolTable IndirectSymTable
The location of the symbol table inside the binary is described by LC_SYMTAB load command.
std::vector< RelocationInfo > Relocations
ReachingDefAnalysis InstSet & ToRemove
void removeSymbols(function_ref< bool(const std::unique_ptr< SymbolEntry > &)> ToRemove)
Optional< SymbolEntry * > Symbol
The Symbol referenced by this entry.
Optional< uint32_t > section() const
@ S_GB_ZEROFILL
S_GB_ZEROFILL - Zero fill on demand section (that can be larger than 4 gigabytes).
ArrayRef< uint8_t > Opcodes
Optional< size_t > DataInCodeCommandIndex
The index LC_DATA_IN_CODE load command if present.
Optional< size_t > FunctionStartsCommandIndex
The index LC_FUNCTION_STARTS load command if present.
Optional< size_t > ChainedFixupsCommandIndex
The index LC_DYLD_CHAINED_FIXUPS load command if present.
@ S_ZEROFILL
S_ZEROFILL - Zero fill on demand section.
ArrayRef< uint8_t > Opcodes
Optional< uint32_t > SwiftVersion
MachO::any_relocation_info Info
bool isSwiftSymbol() const
The location of the export info inside the binary is described by LC_DYLD_INFO load command.
std::vector< IndirectSymbolEntry > Symbols
The location of the bind info inside the binary is described by LC_DYLD_INFO load command.
Optional< StringRef > getSegmentName() const
uint64_t nextAvailableSegmentAddress() const
Error removeLoadCommands(function_ref< bool(const LoadCommand &)> ToRemove)
The location of the weak bind info inside the binary is described by LC_DYLD_INFO load command.
ArrayRef< uint8_t > Opcodes
MachO::SectionType getType() const
void updateLoadCommandIndexes()
This struct is a compact representation of a valid (non-zero power of two) alignment.
Optional< uint64_t > getSegmentVMAddr() const
LinkData LinkerOptimizationHint
bool isExternalSymbol() const
An efficient, type-erasing, non-owning reference to a callable.
std::vector< std::unique_ptr< Section > > Sections
Error removeSections(function_ref< bool(const std::unique_ptr< Section > &)> ToRemove)
std::vector< LoadCommand > LoadCommands
Allocate memory in an ever growing pool, as if by bump-pointer.
MachO::macho_load_command MachOLoadCommand
bool isUndefinedSymbol() const
The location of the lazy bind info inside the binary is described by LC_DYLD_INFO load command.
bool hasValidOffset() const
LoadCommand & addSegment(StringRef SegName, uint64_t SegVMSize)
Creates a new segment load command in the object and returns a reference to the newly created load co...
Optional< size_t > DyLdInfoCommandIndex
The index of LC_DYLD_INFO or LC_DYLD_INFO_ONLY load command if present.
Optional< const Section * > Sec
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
bool isLocalSymbol() const
const SymbolEntry * getSymbolByIndex(uint32_t Index) const
Saves strings in the provided stable storage and returns a StringRef with a stable character pointer.
StringRef - Represent a constant reference to a string, i.e.
ArrayRef< uint8_t > Opcodes
std::vector< uint8_t > Payload
Optional< size_t > DySymTabCommandIndex
The index LC_DYSYMTAB load command if present.
Optional< size_t > TextSegmentCommandIndex
The index of the LC_SEGMENT or LC_SEGMENT_64 load command corresponding to the __TEXT segment.
Twine - A lightweight data structure for efficiently representing the concatenation of temporary valu...
Lightweight error class with error context and mandatory checking.
std::string CanonicalName
@ S_THREAD_LOCAL_ZEROFILL
S_THREAD_LOCAL_ZEROFILL - Thread local zerofill section.
IndirectSymbolEntry(uint32_t OriginalIndex, Optional< SymbolEntry * > Symbol)
Section(StringRef SegName, StringRef SectName, StringRef Content)
std::vector< std::unique_ptr< SymbolEntry > > Symbols
Optional< size_t > ExportsTrieCommandIndex
The index LC_DYLD_EXPORTS_TRIE load command if present.
The location of the rebase info inside the binary is described by LC_DYLD_INFO load command.
Section(StringRef SegName, StringRef SectName)
std::vector< std::string > Strings
void setPlainRelocationSymbolNum(unsigned SymbolNum, bool IsLittleEndian)
An iterator type that allows iterating over the pointees via some other iterator.
bool isVirtualSection() const
The location of the string table inside the binary is described by LC_SYMTAB load command.
Optional< size_t > CodeSignatureCommandIndex
The index of LC_CODE_SIGNATURE load command if present.
SectionType
These are the section type and attributes fields.
Optional< uint32_t > OriginalOffset