LLVM 18.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 | 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 1026 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 1042 of file ELFObject.h.
Error Object::addNewSymbolTable | ( | ) |
Definition at line 2235 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 1096 of file ELFObject.h.
References MustBeRelocatable, and Ptr.
Referenced by handleArgs(), and replaceAndRemoveSections().
Definition at line 1105 of file ELFObject.h.
References llvm::Data.
|
inline |
Definition at line 1076 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().
|
inline |
Definition at line 1083 of file ELFObject.h.
References llvm::find_if(), and Name.
Referenced by addSymbol().
|
inline |
Definition at line 1080 of file ELFObject.h.
|
inline |
Definition at line 1109 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 1088 of file ELFObject.h.
Error Object::removeSections | ( | bool | AllowBrokenLinks, |
std::function< bool(const SectionBase &)> | ToRemove | ||
) |
Definition at line 2151 of file ELFObject.cpp.
References E, llvm::make_range(), llvm::objcopy::elf::Segment::removeSection(), llvm::objcopy::elf::SectionIndexSection::reserve(), SectionIndexTable, SectionNames, 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 2227 of file ELFObject.cpp.
References E, llvm::Error::success(), SymbolTable, and ToRemove.
Referenced by updateAndRemoveSymbols().
Error Object::replaceSections | ( | const DenseMap< SectionBase *, SectionBase * > & | FromTo | ) |
Definition at line 2203 of file ELFObject.cpp.
References assert(), llvm::DenseMapBase< DerivedT, KeyT, ValueT, KeyInfoT, BucketT >::count(), E, I, llvm::is_sorted(), removeSections(), llvm::sort(), and llvm::Error::success().
Referenced by replaceDebugSections().
|
inline |
Definition at line 1072 of file ELFObject.h.
Referenced by addNewSymbolTable(), dumpSectionToFile(), llvm::objcopy::elf::IHexWriter::finalize(), handleArgs(), layoutSectionsForOnlyKeepDebug(), replaceDebugSections(), and updateAndRemoveSymbols().
|
inline |
Definition at line 1090 of file ELFObject.h.
References llvm::make_pointee_range().
Definition at line 2120 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 1056 of file ELFObject.h.
Segment llvm::objcopy::elf::Object::ElfHdrSegment |
Definition at line 1051 of file ELFObject.h.
uint64_t llvm::objcopy::elf::Object::Entry |
Definition at line 1057 of file ELFObject.h.
Referenced by llvm::objcopy::elf::IHexWriter::finalize(), and handleArgs().
uint32_t llvm::objcopy::elf::Object::Flags |
Definition at line 1062 of file ELFObject.h.
Definition at line 1064 of file ELFObject.h.
bool llvm::objcopy::elf::Object::Is64Bits |
Definition at line 1054 of file ELFObject.h.
Referenced by replaceAndRemoveSections().
bool llvm::objcopy::elf::Object::IsMips64EL = false |
Definition at line 1070 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 1060 of file ELFObject.h.
Referenced by handleArgs(), and isRequiredByABISymbol().
bool llvm::objcopy::elf::Object::MustBeRelocatable = false |
Definition at line 1065 of file ELFObject.h.
Referenced by addSection(), and isRelocatable().
uint8_t llvm::objcopy::elf::Object::OSABI |
Definition at line 1055 of file ELFObject.h.
Referenced by handleArgs().
Segment llvm::objcopy::elf::Object::ProgramHdrSegment |
Definition at line 1052 of file ELFObject.h.
SectionIndexSection* llvm::objcopy::elf::Object::SectionIndexTable = nullptr |
Definition at line 1068 of file ELFObject.h.
Referenced by removeSections().
StringTableSection* llvm::objcopy::elf::Object::SectionNames = nullptr |
Definition at line 1066 of file ELFObject.h.
Referenced by addNewSymbolTable(), onlyKeepDWOPred(), removeSections(), removeUnneededSections(), and replaceAndRemoveSections().
uint64_t llvm::objcopy::elf::Object::SHOff |
Definition at line 1058 of file ELFObject.h.
SymbolTableSection* llvm::objcopy::elf::Object::SymbolTable = nullptr |
Definition at line 1067 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 1059 of file ELFObject.h.
uint32_t llvm::objcopy::elf::Object::Version |
Definition at line 1061 of file ELFObject.h.