LLVM 20.0.0git
|
#include "ObjCopy/ELF/ELFObject.h"
Public Types | |
template<class T > | |
using | ConstRange = iterator_range< pointee_iterator< typename std::vector< std::unique_ptr< T > >::const_iterator > > |
Public Member Functions | |
SectionTableRef | sections () const |
iterator_range< filter_iterator< pointee_iterator< std::vector< SecPtr >::const_iterator >, decltype(§ionIsAlloc)> > | allocSections () const |
const auto & | getUpdatedSections () const |
Error | updateSection (StringRef Name, ArrayRef< uint8_t > Data) |
SectionBase * | findSection (StringRef Name) |
SectionTableRef | removedSections () |
ConstRange< Segment > | segments () const |
Error | removeSections (bool AllowBrokenLinks, std::function< bool(const SectionBase &)> ToRemove) |
Error | compressOrDecompressSections (const CommonConfig &Config) |
Error | replaceSections (const DenseMap< SectionBase *, SectionBase * > &FromTo) |
Error | removeSymbols (function_ref< bool(const Symbol &)> ToRemove) |
template<class T , class... Ts> | |
T & | addSection (Ts &&...Args) |
Error | addNewSymbolTable () |
Segment & | addSegment (ArrayRef< uint8_t > Data) |
bool | isRelocatable () const |
Public Attributes | |
Segment | ElfHdrSegment |
Segment | ProgramHdrSegment |
bool | Is64Bits |
uint8_t | OSABI |
uint8_t | ABIVersion |
uint64_t | Entry |
uint64_t | SHOff |
uint32_t | Type |
uint32_t | Machine |
uint32_t | Version |
uint32_t | Flags |
bool | HadShdrs = true |
bool | MustBeRelocatable = false |
StringTableSection * | SectionNames = nullptr |
SymbolTableSection * | SymbolTable = nullptr |
SectionIndexSection * | SectionIndexTable = nullptr |
bool | IsMips64EL = false |
Definition at line 1153 of file ELFObject.h.
using llvm::objcopy::elf::Object::ConstRange = iterator_range<pointee_iterator< typename std::vector<std::unique_ptr<T> >::const_iterator> > |
Definition at line 1169 of file ELFObject.h.
Error Object::addNewSymbolTable | ( | ) |
Definition at line 2284 of file ELFObject.cpp.
References llvm::objcopy::elf::SymbolTableSection::addSymbol(), assert(), llvm::objcopy::elf::SectionBase::Index, llvm::objcopy::elf::SymbolTableSection::initialize(), llvm::objcopy::elf::SectionBase::Link, llvm::objcopy::elf::SectionBase::Name, SectionNames, sections(), llvm::ELF::SHF_ALLOC, llvm::ELF::SHT_STRTAB, llvm::Error::success(), and SymbolTable.
Referenced by handleArgs().
Definition at line 1224 of file ELFObject.h.
References MustBeRelocatable, and Ptr.
Referenced by handleArgs().
Definition at line 1233 of file ELFObject.h.
References llvm::Data.
|
inline |
Definition at line 1203 of file ELFObject.h.
References llvm::make_filter_range(), and llvm::make_pointee_range().
Referenced by llvm::objcopy::elf::BinaryWriter::finalize(), and llvm::objcopy::elf::BinaryWriter::write().
Error Object::compressOrDecompressSections | ( | const CommonConfig & | Config | ) |
Definition at line 217 of file ELFObjcopy.cpp.
References Config, llvm::createStringError(), llvm::invalid_argument, Is64Bits, llvm::None, replaceSections(), sections(), llvm::ELF::SHF_ALLOC, and llvm::StringRef::starts_with().
Referenced by replaceAndRemoveSections().
|
inline |
Definition at line 1210 of file ELFObject.h.
References llvm::find_if(), and Name.
Referenced by addSymbol().
|
inline |
Definition at line 1207 of file ELFObject.h.
|
inline |
Definition at line 1237 of file ELFObject.h.
References llvm::ELF::ET_DYN, llvm::ELF::ET_EXEC, and MustBeRelocatable.
Referenced by isRequiredByABISymbol(), removeUnneededSections(), and updateAndRemoveSymbols().
|
inline |
Definition at line 1215 of file ELFObject.h.
Error Object::removeSections | ( | bool | AllowBrokenLinks, |
std::function< bool(const SectionBase &)> | ToRemove | ||
) |
Definition at line 2191 of file ELFObject.cpp.
References if(), llvm::make_range(), llvm::objcopy::elf::Segment::removeSection(), llvm::objcopy::elf::SectionIndexSection::reserve(), SectionIndexTable, SectionNames, llvm::ELF::SHT_GROUP, llvm::Error::success(), SymbolTable, and ToRemove.
Referenced by handleArgs(), removeUnneededSections(), replaceAndRemoveSections(), and replaceSections().
Error Object::removeSymbols | ( | function_ref< bool(const Symbol &)> | ToRemove | ) |
Definition at line 2276 of file ELFObject.cpp.
References llvm::Error::success(), SymbolTable, and ToRemove.
Referenced by updateAndRemoveSymbols().
Error Object::replaceSections | ( | const DenseMap< SectionBase *, SectionBase * > & | FromTo | ) |
Definition at line 2252 of file ELFObject.cpp.
References assert(), llvm::DenseMapBase< DerivedT, KeyT, ValueT, KeyInfoT, BucketT >::count(), I, llvm::is_sorted(), removeSections(), llvm::sort(), and llvm::Error::success().
Referenced by compressOrDecompressSections().
|
inline |
Definition at line 1199 of file ELFObject.h.
Referenced by addNewSymbolTable(), compressOrDecompressSections(), dumpSectionToFile(), llvm::objcopy::elf::ASCIIHexWriter::finalize(), handleArgs(), layoutSectionsForOnlyKeepDebug(), and updateAndRemoveSymbols().
|
inline |
Definition at line 1217 of file ELFObject.h.
References llvm::make_pointee_range().
Referenced by handleArgs().
Definition at line 2160 of file ELFObject.cpp.
References llvm::createStringError(), llvm::Data, llvm::find_if(), llvm::invalid_argument, Name, and llvm::Error::success().
Referenced by handleArgs().
uint8_t llvm::objcopy::elf::Object::ABIVersion |
Definition at line 1183 of file ELFObject.h.
Segment llvm::objcopy::elf::Object::ElfHdrSegment |
Definition at line 1178 of file ELFObject.h.
uint64_t llvm::objcopy::elf::Object::Entry |
Definition at line 1184 of file ELFObject.h.
Referenced by llvm::objcopy::elf::ASCIIHexWriter::finalize(), handleArgs(), and llvm::objcopy::elf::SRECWriter::write().
uint32_t llvm::objcopy::elf::Object::Flags |
Definition at line 1189 of file ELFObject.h.
Definition at line 1191 of file ELFObject.h.
bool llvm::objcopy::elf::Object::Is64Bits |
Definition at line 1181 of file ELFObject.h.
Referenced by compressOrDecompressSections().
bool llvm::objcopy::elf::Object::IsMips64EL = false |
Definition at line 1197 of file ELFObject.h.
Referenced by llvm::objcopy::elf::ELFBuilder< ELFT >::ELFBuilder(), initRelocations(), and llvm::objcopy::elf::ELFSectionWriter< ELFT >::visit().
uint32_t llvm::objcopy::elf::Object::Machine |
Definition at line 1187 of file ELFObject.h.
Referenced by handleArgs(), and isRequiredByABISymbol().
bool llvm::objcopy::elf::Object::MustBeRelocatable = false |
Definition at line 1192 of file ELFObject.h.
Referenced by addSection(), and isRelocatable().
uint8_t llvm::objcopy::elf::Object::OSABI |
Definition at line 1182 of file ELFObject.h.
Referenced by handleArgs().
Segment llvm::objcopy::elf::Object::ProgramHdrSegment |
Definition at line 1179 of file ELFObject.h.
SectionIndexSection* llvm::objcopy::elf::Object::SectionIndexTable = nullptr |
Definition at line 1195 of file ELFObject.h.
Referenced by removeSections().
StringTableSection* llvm::objcopy::elf::Object::SectionNames = nullptr |
Definition at line 1193 of file ELFObject.h.
Referenced by addNewSymbolTable(), onlyKeepDWOPred(), removeSections(), removeUnneededSections(), and replaceAndRemoveSections().
uint64_t llvm::objcopy::elf::Object::SHOff |
Definition at line 1185 of file ELFObject.h.
SymbolTableSection* llvm::objcopy::elf::Object::SymbolTable = nullptr |
Definition at line 1194 of file ELFObject.h.
Referenced by addNewSymbolTable(), addSymbol(), handleArgs(), initRelocations(), removeSections(), removeSymbols(), removeUnneededSections(), replaceAndRemoveSections(), and updateAndRemoveSymbols().
uint32_t llvm::objcopy::elf::Object::Type |
Definition at line 1186 of file ELFObject.h.
Referenced by handleArgs().
uint32_t llvm::objcopy::elf::Object::Version |
Definition at line 1188 of file ELFObject.h.