LLVM 19.0.0git
Public Types | Public Member Functions | Public Attributes | List of all members
llvm::objcopy::elf::Object Class Reference

#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(&sectionIsAlloc)> > allocSections () const
 
const auto & getUpdatedSections () const
 
Error updateSection (StringRef Name, 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 1145 of file ELFObject.h.

Member Typedef Documentation

◆ ConstRange

template<class T >
using llvm::objcopy::elf::Object::ConstRange = iterator_range<pointee_iterator< typename std::vector<std::unique_ptr<T> >::const_iterator> >

Definition at line 1161 of file ELFObject.h.

Member Function Documentation

◆ addNewSymbolTable()

Error Object::addNewSymbolTable ( )

◆ addSection()

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

Definition at line 1216 of file ELFObject.h.

References MustBeRelocatable, and Ptr.

Referenced by handleArgs().

◆ addSegment()

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

Definition at line 1225 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

◆ compressOrDecompressSections()

Error Object::compressOrDecompressSections ( const CommonConfig Config)

◆ findSection()

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

Definition at line 1202 of file ELFObject.h.

References llvm::find_if(), and Name.

Referenced by addSymbol().

◆ getUpdatedSections()

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

Definition at line 1199 of file ELFObject.h.

◆ isRelocatable()

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

◆ removedSections()

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

Definition at line 1207 of file ELFObject.h.

◆ removeSections()

Error Object::removeSections ( bool  AllowBrokenLinks,
std::function< bool(const SectionBase &)>  ToRemove 
)

◆ removeSymbols()

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

Definition at line 2238 of file ELFObject.cpp.

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

Referenced by updateAndRemoveSymbols().

◆ replaceSections()

Error Object::replaceSections ( const DenseMap< SectionBase *, SectionBase * > &  FromTo)

◆ sections()

SectionTableRef llvm::objcopy::elf::Object::sections ( ) const
inline

◆ segments()

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

Definition at line 1209 of file ELFObject.h.

References llvm::make_pointee_range().

◆ updateSection()

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

Member Data Documentation

◆ ABIVersion

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

Definition at line 1175 of file ELFObject.h.

◆ ElfHdrSegment

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

Definition at line 1170 of file ELFObject.h.

◆ Entry

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

◆ Flags

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

Definition at line 1181 of file ELFObject.h.

◆ HadShdrs

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

Definition at line 1183 of file ELFObject.h.

◆ Is64Bits

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

Definition at line 1173 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 1179 of file ELFObject.h.

Referenced by handleArgs(), and isRequiredByABISymbol().

◆ MustBeRelocatable

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

Definition at line 1184 of file ELFObject.h.

Referenced by addSection(), and isRelocatable().

◆ OSABI

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

Definition at line 1174 of file ELFObject.h.

Referenced by handleArgs().

◆ ProgramHdrSegment

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

Definition at line 1171 of file ELFObject.h.

◆ SectionIndexTable

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

Definition at line 1187 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 1177 of file ELFObject.h.

◆ SymbolTable

SymbolTableSection* llvm::objcopy::elf::Object::SymbolTable = nullptr

◆ Type

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

Definition at line 1178 of file ELFObject.h.

◆ Version

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

Definition at line 1180 of file ELFObject.h.


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