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

#include "ObjCopy/ELF/ELFObject.h"

Collaboration diagram for llvm::objcopy::elf::Object:
Collaboration graph
[legend]

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 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 ()
 
SegmentaddSegment (ArrayRef< uint8_t > Data)
 
bool isRelocatable () const
 

Public Attributes

Segment ElfHdrSegment
 
Segment ProgramHdrSegment
 
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 1017 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 1034 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 1086 of file ELFObject.h.

References llvm::AMDGPU::HSAMD::Kernel::Key::Args, move, MustBeRelocatable, Ptr, and T.

Referenced by handleArgs().

◆ addSegment()

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

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

◆ findSection()

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

Definition at line 1073 of file ELFObject.h.

References llvm::find_if().

Referenced by addSymbol().

◆ getUpdatedSections()

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

Definition at line 1070 of file ELFObject.h.

◆ isRelocatable()

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

◆ removedSections()

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

Definition at line 1078 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 2186 of file ELFObject.cpp.

References E, 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 1080 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 1046 of file ELFObject.h.

◆ ElfHdrSegment

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

Definition at line 1042 of file ELFObject.h.

◆ Entry

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

Definition at line 1047 of file ELFObject.h.

Referenced by llvm::objcopy::elf::IHexWriter::finalize(), and handleArgs().

◆ Flags

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

Definition at line 1052 of file ELFObject.h.

◆ HadShdrs

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

Definition at line 1054 of file ELFObject.h.

◆ IsMips64EL

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

◆ Machine

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

Definition at line 1050 of file ELFObject.h.

Referenced by handleArgs(), and isRequiredByABISymbol().

◆ MustBeRelocatable

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

Definition at line 1055 of file ELFObject.h.

Referenced by addSection(), and isRelocatable().

◆ OSABI

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

Definition at line 1045 of file ELFObject.h.

Referenced by handleArgs().

◆ ProgramHdrSegment

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

Definition at line 1043 of file ELFObject.h.

◆ SectionIndexTable

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

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

◆ SymbolTable

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

◆ Type

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

Definition at line 1049 of file ELFObject.h.

◆ Version

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

Definition at line 1051 of file ELFObject.h.


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