LLVM  15.0.0git
Public Member Functions | Static Public Member Functions | Protected Types | Protected Attributes | List of all members
llvm::objcopy::elf::SymbolTableSection Class Reference

#include "ObjCopy/ELF/ELFObject.h"

Inheritance diagram for llvm::objcopy::elf::SymbolTableSection:
Inheritance graph
[legend]
Collaboration diagram for llvm::objcopy::elf::SymbolTableSection:
Collaboration graph
[legend]

Public Member Functions

 SymbolTableSection ()
 
void addSymbol (Twine Name, uint8_t Bind, uint8_t Type, SectionBase *DefinedIn, uint64_t Value, uint8_t Visibility, uint16_t Shndx, uint64_t SymbolSize)
 
void prepareForLayout ()
 
bool empty () const
 
void setShndxTable (SectionIndexSection *ShndxTable)
 
const SectionIndexSectiongetShndxTable () const
 
void fillShndxTable ()
 
const SectionBasegetStrTab () const
 
Expected< const Symbol * > getSymbolByIndex (uint32_t Index) const
 
Expected< Symbol * > getSymbolByIndex (uint32_t Index)
 
void updateSymbols (function_ref< void(Symbol &)> Callable)
 
Error removeSectionReferences (bool AllowBrokenLinks, function_ref< bool(const SectionBase *)> ToRemove) override
 
Error initialize (SectionTableRef SecTable) override
 
void finalize () override
 
Error accept (SectionVisitor &Visitor) const override
 
Error accept (MutableSectionVisitor &Visitor) override
 
Error removeSymbols (function_ref< bool(const Symbol &)> ToRemove) override
 
void replaceSectionReferences (const DenseMap< SectionBase *, SectionBase * > &FromTo) override
 
- Public Member Functions inherited from llvm::objcopy::elf::SectionBase
 SectionBase ()=default
 
 SectionBase (const SectionBase &)=default
 
virtual ~SectionBase ()=default
 
virtual void markSymbols ()
 
virtual bool hasContents () const
 
virtual void onRemove ()
 

Static Public Member Functions

static bool classof (const SectionBase *S)
 

Protected Types

using SymPtr = std::unique_ptr< Symbol >
 

Protected Attributes

std::vector< std::unique_ptr< Symbol > > Symbols
 
StringTableSectionSymbolNames = nullptr
 
SectionIndexSectionSectionIndexTable = nullptr
 

Additional Inherited Members

- Public Attributes inherited from llvm::objcopy::elf::SectionBase
std::string Name
 
SegmentParentSegment = nullptr
 
uint64_t HeaderOffset = 0
 
uint32_t Index = 0
 
uint32_t OriginalIndex = 0
 
uint64_t OriginalFlags = 0
 
uint64_t OriginalType = ELF::SHT_NULL
 
uint64_t OriginalOffset = std::numeric_limits<uint64_t>::max()
 
uint64_t Addr = 0
 
uint64_t Align = 1
 
uint32_t EntrySize = 0
 
uint64_t Flags = 0
 
uint64_t Info = 0
 
uint64_t Link = ELF::SHN_UNDEF
 
uint64_t NameIndex = 0
 
uint64_t Offset = 0
 
uint64_t Size = 0
 
uint64_t Type = ELF::SHT_NULL
 
ArrayRef< uint8_t > OriginalData
 
bool HasSymbol = false
 

Detailed Description

Definition at line 681 of file ELFObject.h.

Member Typedef Documentation

◆ SymPtr

using llvm::objcopy::elf::SymbolTableSection::SymPtr = std::unique_ptr<Symbol>
protected

Definition at line 692 of file ELFObject.h.

Constructor & Destructor Documentation

◆ SymbolTableSection()

llvm::objcopy::elf::SymbolTableSection::SymbolTableSection ( )
inline

Member Function Documentation

◆ accept() [1/2]

Error SymbolTableSection::accept ( MutableSectionVisitor Visitor)
overridevirtual

◆ accept() [2/2]

Error SymbolTableSection::accept ( SectionVisitor Visitor) const
overridevirtual

◆ addSymbol()

void SymbolTableSection::addSymbol ( Twine  Name,
uint8_t  Bind,
uint8_t  Type,
SectionBase DefinedIn,
uint64_t  Value,
uint8_t  Visibility,
uint16_t  Shndx,
uint64_t  SymbolSize 
)

◆ classof()

static bool llvm::objcopy::elf::SymbolTableSection::classof ( const SectionBase S)
inlinestatic

Definition at line 724 of file ELFObject.h.

References S, and llvm::ELF::SHT_SYMTAB.

◆ empty()

bool llvm::objcopy::elf::SymbolTableSection::empty ( ) const
inline

Definition at line 702 of file ELFObject.h.

References Symbols.

Referenced by removeUnneededSections(), and replaceAndRemoveSections().

◆ fillShndxTable()

void SymbolTableSection::fillShndxTable ( )

◆ finalize()

void SymbolTableSection::finalize ( )
overridevirtual

◆ getShndxTable()

const SectionIndexSection* llvm::objcopy::elf::SymbolTableSection::getShndxTable ( ) const
inline

Definition at line 706 of file ELFObject.h.

References SectionIndexTable.

◆ getStrTab()

const SectionBase* llvm::objcopy::elf::SymbolTableSection::getStrTab ( ) const
inline

Definition at line 708 of file ELFObject.h.

References SymbolNames.

Referenced by removeUnneededSections(), and replaceAndRemoveSections().

◆ getSymbolByIndex() [1/2]

Expected< Symbol * > SymbolTableSection::getSymbolByIndex ( uint32_t  Index)

Definition at line 832 of file ELFObject.cpp.

References getSymbolByIndex(), and llvm::Expected< T >::takeError().

◆ getSymbolByIndex() [2/2]

Expected< const Symbol * > SymbolTableSection::getSymbolByIndex ( uint32_t  Index) const

◆ initialize()

Error SymbolTableSection::initialize ( SectionTableRef  SecTable)
overridevirtual

◆ prepareForLayout()

void SymbolTableSection::prepareForLayout ( )

◆ removeSectionReferences()

Error SymbolTableSection::removeSectionReferences ( bool  AllowBrokenLinks,
function_ref< bool(const SectionBase *)>  ToRemove 
)
overridevirtual

◆ removeSymbols()

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

◆ replaceSectionReferences()

void SymbolTableSection::replaceSectionReferences ( const DenseMap< SectionBase *, SectionBase * > &  FromTo)
overridevirtual

◆ setShndxTable()

void llvm::objcopy::elf::SymbolTableSection::setShndxTable ( SectionIndexSection ShndxTable)
inline

Definition at line 703 of file ELFObject.h.

References SectionIndexTable.

Referenced by llvm::objcopy::elf::SectionIndexSection::initialize().

◆ updateSymbols()

void SymbolTableSection::updateSymbols ( function_ref< void(Symbol &)>  Callable)

Member Data Documentation

◆ SectionIndexTable

SectionIndexSection* llvm::objcopy::elf::SymbolTableSection::SectionIndexTable = nullptr
protected

◆ SymbolNames

StringTableSection* llvm::objcopy::elf::SymbolTableSection::SymbolNames = nullptr
protected

Definition at line 689 of file ELFObject.h.

Referenced by finalize(), getStrTab(), prepareForLayout(), and removeSectionReferences().

◆ Symbols

std::vector<std::unique_ptr<Symbol> > llvm::objcopy::elf::SymbolTableSection::Symbols
protected

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