LLVM 20.0.0git
|
#include "llvm/ObjCopy/MachO/MachOObjcopy.h"
#include "Archive.h"
#include "MachOReader.h"
#include "MachOWriter.h"
#include "llvm/ADT/DenseSet.h"
#include "llvm/ObjCopy/CommonConfig.h"
#include "llvm/ObjCopy/MachO/MachOConfig.h"
#include "llvm/ObjCopy/MultiFormatConfig.h"
#include "llvm/ObjCopy/ObjCopy.h"
#include "llvm/Object/ArchiveWriter.h"
#include "llvm/Object/MachOUniversal.h"
#include "llvm/Object/MachOUniversalWriter.h"
#include "llvm/Support/Errc.h"
#include "llvm/Support/Error.h"
#include "llvm/Support/FileOutputBuffer.h"
#include "llvm/Support/Path.h"
#include "llvm/Support/SmallVectorMemoryBuffer.h"
Go to the source code of this file.
Typedefs | |
using | SectionPred = std::function< bool(const std::unique_ptr< Section > &Sec)> |
using | LoadCommandPred = std::function< bool(const LoadCommand &LC)> |
using LoadCommandPred = std::function<bool(const LoadCommand &LC)> |
Definition at line 33 of file MachOObjcopy.cpp.
using SectionPred = std::function<bool(const std::unique_ptr<Section> &Sec)> |
Definition at line 32 of file MachOObjcopy.cpp.
|
static |
Definition at line 311 of file MachOObjcopy.cpp.
References Addr, llvm::objcopy::macho::Object::addSegment(), llvm::alignTo(), llvm::objcopy::macho::Section::Content, llvm::objcopy::macho::LoadCommand::getSegmentName(), llvm::objcopy::macho::LoadCommand::getSegmentVMAddr(), llvm::objcopy::macho::Object::LoadCommands, llvm::objcopy::macho::Object::NewSectionsContents, llvm::StringSaver::save(), llvm::objcopy::NewSectionInfo::SectionData, llvm::objcopy::NewSectionInfo::SectionName, llvm::objcopy::macho::LoadCommand::Sections, llvm::StringRef::size(), llvm::objcopy::macho::Section::Size, llvm::StringRef::split(), and llvm::Error::success().
Referenced by handleArgs().
|
static |
Definition at line 148 of file MachOObjcopy.cpp.
References llvm::alignTo(), llvm::MachO::rpath_command::cmd, llvm::MachO::rpath_command::cmdsize, llvm::objcopy::macho::LoadCommand::MachOLoadCommand, llvm::MachO::rpath_command::path, and llvm::objcopy::macho::LoadCommand::Payload.
Referenced by processLoadCommands().
Definition at line 289 of file MachOObjcopy.cpp.
References llvm::copy(), llvm::FileOutputBuffer::create(), llvm::createStringError(), llvm::objcopy::macho::Object::LoadCommands, llvm::objcopy::macho::LoadCommand::Sections, llvm::StringRef::str(), llvm::Error::success(), and llvm::Expected< T >::takeError().
Referenced by handleArgs().
Definition at line 341 of file MachOObjcopy.cpp.
References assert(), llvm::createStringError(), llvm::find_if(), llvm::StringRef::split(), and llvm::StringRef::str().
Referenced by updateSection().
|
static |
Definition at line 46 of file MachOObjcopy.cpp.
References assert(), isLoadCommandWithPayloadString(), llvm::objcopy::macho::LoadCommand::Payload, and llvm::StringRef::rtrim().
Referenced by processLoadCommands().
|
static |
Definition at line 403 of file MachOObjcopy.cpp.
References addSection(), Config, dumpSectionToFile(), isValidMachOCannonicalName(), llvm::objcopy::macho::Object::LoadCommands, markSymbols(), processLoadCommands(), removeSections(), llvm::objcopy::NewSectionInfo::SectionName, llvm::objcopy::macho::LoadCommand::Sections, llvm::Error::success(), updateAndRemoveSymbols(), and updateSection().
Referenced by llvm::objcopy::macho::executeObjcopyOnBinary().
|
static |
Definition at line 36 of file MachOObjcopy.cpp.
References llvm::objcopy::macho::LoadCommand::MachOLoadCommand.
Referenced by getPayloadString(), and updateLoadCommandPayloadString().
Definition at line 384 of file MachOObjcopy.cpp.
References llvm::createStringError(), Name, and llvm::Error::success().
Referenced by handleArgs().
|
static |
Definition at line 86 of file MachOObjcopy.cpp.
References llvm::objcopy::macho::Object::IndirectSymTable, llvm::objcopy::macho::IndirectSymbolEntry::Symbol, and llvm::objcopy::macho::IndirectSymbolTable::Symbols.
Referenced by handleArgs().
|
static |
Definition at line 160 of file MachOObjcopy.cpp.
References buildRPathLoadCommand(), llvm::detail::DenseSetImpl< ValueT, MapTy, ValueInfoT >::contains(), llvm::detail::DenseSetImpl< ValueT, MapTy, ValueInfoT >::count(), llvm::createStringError(), llvm::StringRef::empty(), llvm::objcopy::MachOConfig::EmptySegmentsToRemove, llvm::detail::DenseSetImpl< ValueT, MapTy, ValueInfoT >::erase(), getPayloadString(), llvm::objcopy::macho::LoadCommand::getSegmentName(), llvm::detail::DenseSetImpl< ValueT, MapTy, ValueInfoT >::insert(), llvm::objcopy::MachOConfig::InstallNamesToUpdate, llvm::objcopy::macho::Object::LoadCommands, llvm::objcopy::macho::LoadCommand::MachOLoadCommand, llvm::objcopy::MachOConfig::RemoveAllRpaths, llvm::objcopy::macho::Object::removeLoadCommands(), llvm::objcopy::MachOConfig::RPathsToRemove, llvm::objcopy::MachOConfig::RPathsToUpdate, llvm::objcopy::MachOConfig::RPathToAdd, llvm::objcopy::MachOConfig::RPathToPrepend, llvm::objcopy::macho::LoadCommand::Sections, llvm::objcopy::MachOConfig::SharedLibId, llvm::StringRef::str(), llvm::Error::success(), and llvm::objcopy::macho::Object::updateLoadCommandIndexes().
Referenced by handleArgs().
|
static |
Definition at line 55 of file MachOObjcopy.cpp.
References Config, and llvm::objcopy::macho::Object::removeSections().
Referenced by handleArgs().
|
static |
Definition at line 93 of file MachOObjcopy.cpp.
References Config, llvm::objcopy::macho::MachHeader::Flags, llvm::objcopy::macho::Object::Header, I, llvm::objcopy::MachOConfig::KeepUndefined, llvm::MachO::MH_DYLDLINK, N, llvm::MachO::N_EXT, llvm::MachO::N_STAB, llvm::MachO::N_TYPE, llvm::MachO::N_UNDF, llvm::MachO::N_WEAK_DEF, llvm::MachO::REFERENCED_DYNAMICALLY, llvm::objcopy::macho::SymbolTable::removeSymbols(), llvm::objcopy::MachOConfig::StripSwiftSymbols, llvm::objcopy::macho::Object::SwiftVersion, Sym, and llvm::objcopy::macho::Object::SymTable.
Referenced by handleArgs().
|
static |
Definition at line 137 of file MachOObjcopy.cpp.
References llvm::alignTo(), assert(), llvm::StringRef::begin(), llvm::StringRef::end(), isLoadCommandWithPayloadString(), llvm::objcopy::macho::LoadCommand::MachOLoadCommand, llvm::objcopy::macho::LoadCommand::Payload, and llvm::StringRef::size().
|
static |
Definition at line 365 of file MachOObjcopy.cpp.
References llvm::objcopy::macho::Section::Content, llvm::createStringError(), findSection(), llvm::objcopy::NewSectionInfo::SectionData, llvm::objcopy::NewSectionInfo::SectionName, llvm::StringRef::size(), llvm::objcopy::macho::Section::Size, llvm::Error::success(), and llvm::Expected< T >::takeError().
Referenced by handleArgs().