LLVM
17.0.0git
|
#include "ObjCopy/ELF/ELFObject.h"
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 |
StringTableSection * | SymbolNames = nullptr |
SectionIndexSection * | SectionIndexTable = nullptr |
Additional Inherited Members | |
![]() | |
std::string | Name |
Segment * | ParentSegment = 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 |
Definition at line 684 of file ELFObject.h.
|
protected |
Definition at line 695 of file ELFObject.h.
|
inline |
Definition at line 698 of file ELFObject.h.
References llvm::objcopy::elf::SectionBase::OriginalType, and llvm::ELF::SHT_SYMTAB.
|
overridevirtual |
Implements llvm::objcopy::elf::SectionBase.
Definition at line 852 of file ELFObject.cpp.
References llvm::objcopy::elf::MutableSectionVisitor::visit().
|
overridevirtual |
Implements llvm::objcopy::elf::SectionBase.
Definition at line 848 of file ELFObject.cpp.
References llvm::objcopy::elf::SectionVisitor::visit().
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 | ||
) |
Definition at line 687 of file ELFObject.cpp.
References llvm::objcopy::elf::Symbol::Binding, llvm::objcopy::elf::Symbol::DefinedIn, llvm::objcopy::elf::SectionBase::EntrySize, llvm::objcopy::elf::SectionBase::HasSymbol, llvm::objcopy::elf::Symbol::Index, llvm::objcopy::elf::SectionBase::Name, llvm::objcopy::elf::Symbol::Name, llvm::ELF::SHN_LORESERVE, llvm::objcopy::elf::Symbol::ShndxType, llvm::objcopy::elf::SectionBase::Size, llvm::objcopy::elf::Symbol::Size, llvm::objcopy::elf::SYMBOL_SIMPLE_INDEX, Symbols, llvm::objcopy::elf::SectionBase::Type, llvm::objcopy::elf::Symbol::Type, llvm::objcopy::elf::Symbol::Value, and llvm::objcopy::elf::Symbol::Visibility.
Referenced by addSymbol().
|
inlinestatic |
Definition at line 727 of file ELFObject.h.
References S, and llvm::ELF::SHT_SYMTAB.
|
inline |
Definition at line 705 of file ELFObject.h.
References Symbols.
Referenced by removeUnneededSections(), and replaceAndRemoveSections().
void SymbolTableSection::fillShndxTable | ( | ) |
Definition at line 801 of file ELFObject.cpp.
References llvm::objcopy::elf::SectionIndexSection::addIndex(), SectionIndexTable, llvm::ELF::SHN_LORESERVE, llvm::ELF::SHN_UNDEF, and Symbols.
|
overridevirtual |
Reimplemented from llvm::objcopy::elf::SectionBase.
Definition at line 772 of file ELFObject.cpp.
References llvm::objcopy::elf::StringTableSection::findIndex(), llvm::objcopy::elf::SectionBase::Index, llvm::objcopy::elf::SectionBase::Info, llvm::objcopy::elf::SectionBase::Link, llvm::max(), llvm::ELF::STB_LOCAL, SymbolNames, and Symbols.
|
inline |
Definition at line 709 of file ELFObject.h.
References SectionIndexTable.
|
inline |
Definition at line 711 of file ELFObject.h.
References SymbolNames.
Referenced by removeUnneededSections(), and replaceAndRemoveSections().
Definition at line 822 of file ELFObject.cpp.
References getSymbolByIndex(), and llvm::Expected< T >::takeError().
Definition at line 815 of file ELFObject.cpp.
References llvm::createStringError(), llvm::objcopy::elf::SectionBase::Index, llvm::invalid_argument, and Symbols.
Referenced by getSymbolByIndex(), and initRelocations().
|
overridevirtual |
Reimplemented from llvm::objcopy::elf::SectionBase.
Definition at line 756 of file ELFObject.cpp.
References llvm::objcopy::elf::SectionTableRef::getSectionOfType(), llvm::objcopy::elf::SectionBase::Link, llvm::objcopy::elf::SectionBase::Size, llvm::Error::success(), and llvm::Expected< T >::takeError().
void SymbolTableSection::prepareForLayout | ( | ) |
Definition at line 785 of file ELFObject.cpp.
References llvm::objcopy::elf::StringTableSection::addString(), llvm::objcopy::elf::SectionIndexSection::reserve(), SectionIndexTable, SymbolNames, and Symbols.
|
overridevirtual |
Reimplemented from llvm::objcopy::elf::SectionBase.
Definition at line 712 of file ELFObject.cpp.
References llvm::createStringError(), llvm::objcopy::elf::Symbol::DefinedIn, llvm::invalid_argument, llvm::objcopy::elf::SectionBase::Name, removeSymbols(), SectionIndexTable, SymbolNames, this, and ToRemove.
|
overridevirtual |
Reimplemented from llvm::objcopy::elf::SectionBase.
Definition at line 738 of file ELFObject.cpp.
References llvm::sys::path::begin(), llvm::sys::path::end(), llvm::objcopy::elf::SectionBase::EntrySize, llvm::remove_if(), llvm::objcopy::elf::SectionBase::Size, llvm::Error::success(), Symbols, and ToRemove.
Referenced by removeSectionReferences().
|
overridevirtual |
Reimplemented from llvm::objcopy::elf::SectionBase.
Definition at line 749 of file ELFObject.cpp.
References llvm::DenseMapBase< DenseMap< KeyT, ValueT, DenseMapInfo< KeyT >, llvm::detail::DenseMapPair< KeyT, ValueT > >, KeyT, ValueT, DenseMapInfo< KeyT >, llvm::detail::DenseMapPair< KeyT, ValueT > >::lookup(), and Symbols.
|
inline |
Definition at line 706 of file ELFObject.h.
References SectionIndexTable.
Referenced by llvm::objcopy::elf::SectionIndexSection::initialize().
void SymbolTableSection::updateSymbols | ( | function_ref< void(Symbol &)> | Callable | ) |
Definition at line 729 of file ELFObject.cpp.
References llvm::sys::path::begin(), llvm::drop_begin(), llvm::sys::path::end(), llvm::ELF::STB_LOCAL, and Symbols.
Referenced by updateAndRemoveSymbols().
|
protected |
Definition at line 693 of file ELFObject.h.
Referenced by fillShndxTable(), getShndxTable(), prepareForLayout(), removeSectionReferences(), and setShndxTable().
|
protected |
Definition at line 692 of file ELFObject.h.
Referenced by finalize(), getStrTab(), prepareForLayout(), and removeSectionReferences().
|
protected |
Definition at line 691 of file ELFObject.h.
Referenced by addSymbol(), empty(), fillShndxTable(), finalize(), getSymbolByIndex(), prepareForLayout(), removeSymbols(), replaceSectionReferences(), updateSymbols(), llvm::objcopy::elf::ELFSectionWriter< ELFT >::visit(), and llvm::objcopy::elf::ELFSectionSizer< ELFT >::visit().