LLVM  15.0.0git
Public Member Functions | Public Attributes | List of all members
llvm::objcopy::macho::Object Struct Reference

#include "ObjCopy/MachO/MachOObject.h"

Collaboration diagram for llvm::objcopy::macho::Object:
Collaboration graph
[legend]

Public Member Functions

 Object ()
 
Error removeSections (function_ref< bool(const std::unique_ptr< Section > &)> ToRemove)
 
Error removeLoadCommands (function_ref< bool(const LoadCommand &)> ToRemove)
 
void updateLoadCommandIndexes ()
 
LoadCommandaddSegment (StringRef SegName, uint64_t SegVMSize)
 Creates a new segment load command in the object and returns a reference to the newly created load command. More...
 
bool is64Bit () const
 
uint64_t nextAvailableSegmentAddress () const
 

Public Attributes

MachHeader Header
 
std::vector< LoadCommandLoadCommands
 
SymbolTable SymTable
 
StringTable StrTable
 
RebaseInfo Rebases
 
BindInfo Binds
 
WeakBindInfo WeakBinds
 
LazyBindInfo LazyBinds
 
ExportInfo Exports
 
IndirectSymbolTable IndirectSymTable
 
LinkData DataInCode
 
LinkData LinkerOptimizationHint
 
LinkData FunctionStarts
 
LinkData ExportsTrie
 
LinkData ChainedFixups
 
Optional< uint32_tSwiftVersion
 
Optional< size_tCodeSignatureCommandIndex
 The index of LC_CODE_SIGNATURE load command if present. More...
 
Optional< size_tSymTabCommandIndex
 The index of LC_SYMTAB load command if present. More...
 
Optional< size_tDyLdInfoCommandIndex
 The index of LC_DYLD_INFO or LC_DYLD_INFO_ONLY load command if present. More...
 
Optional< size_tDySymTabCommandIndex
 The index LC_DYSYMTAB load command if present. More...
 
Optional< size_tDataInCodeCommandIndex
 The index LC_DATA_IN_CODE load command if present. More...
 
Optional< size_tLinkerOptimizationHintCommandIndex
 The index of LC_LINKER_OPTIMIZATIN_HINT load command if present. More...
 
Optional< size_tFunctionStartsCommandIndex
 The index LC_FUNCTION_STARTS load command if present. More...
 
Optional< size_tChainedFixupsCommandIndex
 The index LC_DYLD_CHAINED_FIXUPS load command if present. More...
 
Optional< size_tExportsTrieCommandIndex
 The index LC_DYLD_EXPORTS_TRIE load command if present. More...
 
Optional< size_tTextSegmentCommandIndex
 The index of the LC_SEGMENT or LC_SEGMENT_64 load command corresponding to the __TEXT segment. More...
 
BumpPtrAllocator Alloc
 
StringSaver NewSectionsContents
 

Detailed Description

Definition at line 302 of file MachOObject.h.

Constructor & Destructor Documentation

◆ Object()

llvm::objcopy::macho::Object::Object ( )
inline

Definition at line 348 of file MachOObject.h.

Member Function Documentation

◆ addSegment()

LoadCommand & Object::addSegment ( StringRef  SegName,
uint64_t  SegVMSize 
)

Creates a new segment load command in the object and returns a reference to the newly created load command.

The caller should verify that SegName is not too long (SegName.size() should be less than or equal to 16).

Definition at line 172 of file MachOObject.cpp.

References constructSegment(), is64Bit(), LoadCommands, llvm::objcopy::macho::LoadCommand::MachOLoadCommand, move, and nextAvailableSegmentAddress().

Referenced by addSection().

◆ is64Bit()

bool llvm::objcopy::macho::Object::is64Bit ( ) const
inline

◆ nextAvailableSegmentAddress()

uint64_t Object::nextAvailableSegmentAddress ( ) const

◆ removeLoadCommands()

Error Object::removeLoadCommands ( function_ref< bool(const LoadCommand &)>  ToRemove)

Definition at line 79 of file MachOObject.cpp.

References LoadCommands, llvm::Error::success(), and updateLoadCommandIndexes().

Referenced by processLoadCommands().

◆ removeSections()

Error Object::removeSections ( function_ref< bool(const std::unique_ptr< Section > &)>  ToRemove)

Definition at line 90 of file MachOObject.cpp.

References llvm::sys::path::begin(), llvm::sys::path::end(), I, and LoadCommands.

Referenced by removeSections().

◆ updateLoadCommandIndexes()

void Object::updateLoadCommandIndexes ( )

Member Data Documentation

◆ Alloc

BumpPtrAllocator llvm::objcopy::macho::Object::Alloc

Definition at line 345 of file MachOObject.h.

◆ Binds

BindInfo llvm::objcopy::macho::Object::Binds

Definition at line 310 of file MachOObject.h.

◆ ChainedFixups

LinkData llvm::objcopy::macho::Object::ChainedFixups

Definition at line 319 of file MachOObject.h.

◆ ChainedFixupsCommandIndex

Optional<size_t> llvm::objcopy::macho::Object::ChainedFixupsCommandIndex

The index LC_DYLD_CHAINED_FIXUPS load command if present.

Definition at line 338 of file MachOObject.h.

Referenced by updateLoadCommandIndexes().

◆ CodeSignatureCommandIndex

Optional<size_t> llvm::objcopy::macho::Object::CodeSignatureCommandIndex

The index of LC_CODE_SIGNATURE load command if present.

Definition at line 324 of file MachOObject.h.

Referenced by updateLoadCommandIndexes().

◆ DataInCode

LinkData llvm::objcopy::macho::Object::DataInCode

Definition at line 315 of file MachOObject.h.

◆ DataInCodeCommandIndex

Optional<size_t> llvm::objcopy::macho::Object::DataInCodeCommandIndex

The index LC_DATA_IN_CODE load command if present.

Definition at line 332 of file MachOObject.h.

Referenced by updateLoadCommandIndexes().

◆ DyLdInfoCommandIndex

Optional<size_t> llvm::objcopy::macho::Object::DyLdInfoCommandIndex

The index of LC_DYLD_INFO or LC_DYLD_INFO_ONLY load command if present.

Definition at line 328 of file MachOObject.h.

Referenced by updateLoadCommandIndexes().

◆ DySymTabCommandIndex

Optional<size_t> llvm::objcopy::macho::Object::DySymTabCommandIndex

The index LC_DYSYMTAB load command if present.

Definition at line 330 of file MachOObject.h.

Referenced by updateLoadCommandIndexes().

◆ Exports

ExportInfo llvm::objcopy::macho::Object::Exports

Definition at line 313 of file MachOObject.h.

◆ ExportsTrie

LinkData llvm::objcopy::macho::Object::ExportsTrie

Definition at line 318 of file MachOObject.h.

◆ ExportsTrieCommandIndex

Optional<size_t> llvm::objcopy::macho::Object::ExportsTrieCommandIndex

The index LC_DYLD_EXPORTS_TRIE load command if present.

Definition at line 340 of file MachOObject.h.

Referenced by updateLoadCommandIndexes().

◆ FunctionStarts

LinkData llvm::objcopy::macho::Object::FunctionStarts

Definition at line 317 of file MachOObject.h.

◆ FunctionStartsCommandIndex

Optional<size_t> llvm::objcopy::macho::Object::FunctionStartsCommandIndex

The index LC_FUNCTION_STARTS load command if present.

Definition at line 336 of file MachOObject.h.

Referenced by updateLoadCommandIndexes().

◆ Header

MachHeader llvm::objcopy::macho::Object::Header

Definition at line 303 of file MachOObject.h.

Referenced by is64Bit(), nextAvailableSegmentAddress(), and updateAndRemoveSymbols().

◆ IndirectSymTable

IndirectSymbolTable llvm::objcopy::macho::Object::IndirectSymTable

Definition at line 314 of file MachOObject.h.

Referenced by markSymbols().

◆ LazyBinds

LazyBindInfo llvm::objcopy::macho::Object::LazyBinds

Definition at line 312 of file MachOObject.h.

◆ LinkerOptimizationHint

LinkData llvm::objcopy::macho::Object::LinkerOptimizationHint

Definition at line 316 of file MachOObject.h.

◆ LinkerOptimizationHintCommandIndex

Optional<size_t> llvm::objcopy::macho::Object::LinkerOptimizationHintCommandIndex

The index of LC_LINKER_OPTIMIZATIN_HINT load command if present.

Definition at line 334 of file MachOObject.h.

Referenced by updateLoadCommandIndexes().

◆ LoadCommands

std::vector<LoadCommand> llvm::objcopy::macho::Object::LoadCommands

◆ NewSectionsContents

StringSaver llvm::objcopy::macho::Object::NewSectionsContents

Definition at line 346 of file MachOObject.h.

Referenced by addSection().

◆ Rebases

RebaseInfo llvm::objcopy::macho::Object::Rebases

Definition at line 309 of file MachOObject.h.

◆ StrTable

StringTable llvm::objcopy::macho::Object::StrTable

Definition at line 307 of file MachOObject.h.

◆ SwiftVersion

Optional<uint32_t> llvm::objcopy::macho::Object::SwiftVersion

Definition at line 321 of file MachOObject.h.

Referenced by updateAndRemoveSymbols().

◆ SymTabCommandIndex

Optional<size_t> llvm::objcopy::macho::Object::SymTabCommandIndex

The index of LC_SYMTAB load command if present.

Definition at line 326 of file MachOObject.h.

Referenced by updateLoadCommandIndexes().

◆ SymTable

SymbolTable llvm::objcopy::macho::Object::SymTable

Definition at line 306 of file MachOObject.h.

Referenced by updateAndRemoveSymbols().

◆ TextSegmentCommandIndex

Optional<size_t> llvm::objcopy::macho::Object::TextSegmentCommandIndex

The index of the LC_SEGMENT or LC_SEGMENT_64 load command corresponding to the __TEXT segment.

Definition at line 343 of file MachOObject.h.

Referenced by updateLoadCommandIndexes().

◆ WeakBinds

WeakBindInfo llvm::objcopy::macho::Object::WeakBinds

Definition at line 311 of file MachOObject.h.


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