LLVM 22.0.0git
llvm::objcopy::elf::Object Class Reference

#include "ObjCopy/ELF/ELFObject.h"

Public Types

template<class T>
using ConstRange

Public Member Functions

SectionTableRef sections () const
iterator_range< filter_iterator< pointee_iterator< std::vector< SecPtr >::const_iterator >, decltype(&sectionIsAlloc)> > allocSections () const
const auto & getUpdatedSections () const
Error updateSection (StringRef Name, ArrayRef< uint8_t > Data)
Error updateSectionData (SectionBase &S, ArrayRef< uint8_t > Data)
SectionBasefindSection (StringRef Name)
SectionTableRef removedSections ()
ConstRange< Segmentsegments () 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>
TaddSection (Ts &&...Args)
Error addNewSymbolTable ()
SegmentaddSegment (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
StringTableSectionSectionNames = nullptr
SymbolTableSectionSymbolTable = nullptr
SectionIndexSectionSectionIndexTable = nullptr
bool IsMips64EL = false

Detailed Description

Definition at line 1158 of file ELFObject.h.

Member Typedef Documentation

◆ ConstRange

Initial value:
typename std::vector<std::unique_ptr<T>>::const_iterator>>
A range adaptor for a pair of iterators.
An iterator type that allows iterating over the pointees via some other iterator.
Definition iterator.h:324

Definition at line 1176 of file ELFObject.h.

Member Function Documentation

◆ addNewSymbolTable()

◆ addSection()

template<class T, class... Ts>
T & llvm::objcopy::elf::Object::addSection ( Ts &&... Args)
inline

Definition at line 1232 of file ELFObject.h.

References llvm::isa(), MustBeRelocatable, Ptr, and T.

Referenced by addNewSymbolTable(), compressOrDecompressSections(), and handleArgs().

◆ addSegment()

Segment & llvm::objcopy::elf::Object::addSegment ( ArrayRef< uint8_t > Data)
inline

Definition at line 1241 of file ELFObject.h.

References llvm::Data.

◆ allocSections()

iterator_range< filter_iterator< pointee_iterator< std::vector< SecPtr >::const_iterator >, decltype(&sectionIsAlloc)> > llvm::objcopy::elf::Object::allocSections ( ) const
inline

Definition at line 1210 of file ELFObject.h.

References llvm::make_filter_range(), and llvm::make_pointee_range().

◆ compressOrDecompressSections()

◆ findSection()

SectionBase * llvm::objcopy::elf::Object::findSection ( StringRef Name)
inline

Definition at line 1218 of file ELFObject.h.

References llvm::find_if().

Referenced by addSymbol().

◆ getUpdatedSections()

const auto & llvm::objcopy::elf::Object::getUpdatedSections ( ) const
inline

Definition at line 1214 of file ELFObject.h.

◆ isRelocatable()

bool llvm::objcopy::elf::Object::isRelocatable ( ) const
inline

◆ removedSections()

SectionTableRef llvm::objcopy::elf::Object::removedSections ( )
inline

Definition at line 1223 of file ELFObject.h.

◆ removeSections()

◆ removeSymbols()

Error Object::removeSymbols ( function_ref< bool(const Symbol &)> ToRemove)

Definition at line 2285 of file ELFObject.cpp.

References llvm::Error::success(), SymbolTable, and ToRemove.

Referenced by updateAndRemoveSymbols().

◆ replaceSections()

◆ sections()

◆ segments()

ConstRange< Segment > llvm::objcopy::elf::Object::segments ( ) const
inline

Definition at line 1225 of file ELFObject.h.

References llvm::make_pointee_range().

Referenced by handleArgs(), and removeNotes().

◆ updateSection()

Error Object::updateSection ( StringRef Name,
ArrayRef< uint8_t > Data )

Definition at line 2184 of file ELFObject.cpp.

References llvm::createStringError(), llvm::Data, llvm::find_if(), and llvm::invalid_argument.

Referenced by handleArgs().

◆ updateSectionData()

Error Object::updateSectionData ( SectionBase & S,
ArrayRef< uint8_t > Data )

Definition at line 2193 of file ELFObject.cpp.

References assert(), llvm::Data, and llvm::find_if().

Member Data Documentation

◆ ABIVersion

uint8_t llvm::objcopy::elf::Object::ABIVersion

Definition at line 1190 of file ELFObject.h.

◆ ElfHdrSegment

Segment llvm::objcopy::elf::Object::ElfHdrSegment

Definition at line 1185 of file ELFObject.h.

◆ Entry

uint64_t llvm::objcopy::elf::Object::Entry

Definition at line 1191 of file ELFObject.h.

Referenced by handleArgs().

◆ Flags

uint32_t llvm::objcopy::elf::Object::Flags

Definition at line 1196 of file ELFObject.h.

◆ HadShdrs

bool llvm::objcopy::elf::Object::HadShdrs = true

Definition at line 1198 of file ELFObject.h.

◆ Is64Bits

bool llvm::objcopy::elf::Object::Is64Bits

Definition at line 1188 of file ELFObject.h.

Referenced by compressOrDecompressSections().

◆ IsMips64EL

bool llvm::objcopy::elf::Object::IsMips64EL = false

◆ Machine

uint32_t llvm::objcopy::elf::Object::Machine

Definition at line 1194 of file ELFObject.h.

Referenced by handleArgs(), and isRequiredByABISymbol().

◆ MustBeRelocatable

bool llvm::objcopy::elf::Object::MustBeRelocatable = false

Definition at line 1199 of file ELFObject.h.

Referenced by addSection(), and isRelocatable().

◆ OSABI

uint8_t llvm::objcopy::elf::Object::OSABI

Definition at line 1189 of file ELFObject.h.

Referenced by handleArgs().

◆ ProgramHdrSegment

Segment llvm::objcopy::elf::Object::ProgramHdrSegment

Definition at line 1186 of file ELFObject.h.

◆ SectionIndexTable

SectionIndexSection* llvm::objcopy::elf::Object::SectionIndexTable = nullptr

Definition at line 1202 of file ELFObject.h.

Referenced by removeSections().

◆ SectionNames

StringTableSection* llvm::objcopy::elf::Object::SectionNames = nullptr

◆ SHOff

uint64_t llvm::objcopy::elf::Object::SHOff

Definition at line 1192 of file ELFObject.h.

◆ SymbolTable

◆ Type

uint32_t llvm::objcopy::elf::Object::Type

Definition at line 1193 of file ELFObject.h.

Referenced by handleArgs(), and isRelocatable().

◆ Version

uint32_t llvm::objcopy::elf::Object::Version

Definition at line 1195 of file ELFObject.h.


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