LLVM 18.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 |
bool | IndicesChanged = false |
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 688 of file ELFObject.h.
|
protected |
Definition at line 700 of file ELFObject.h.
|
inline |
Definition at line 703 of file ELFObject.h.
References llvm::objcopy::elf::SectionBase::OriginalType, and llvm::ELF::SHT_SYMTAB.
|
overridevirtual |
Implements llvm::objcopy::elf::SectionBase.
Definition at line 865 of file ELFObject.cpp.
References llvm::objcopy::elf::MutableSectionVisitor::visit().
|
overridevirtual |
Implements llvm::objcopy::elf::SectionBase.
Definition at line 861 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 697 of file ELFObject.cpp.
References llvm::objcopy::elf::SectionBase::EntrySize, llvm::objcopy::elf::SectionBase::HasSymbol, llvm::objcopy::elf::SectionBase::Name, llvm::ELF::SHN_LORESERVE, llvm::objcopy::elf::SectionBase::Size, Sym, llvm::objcopy::elf::SYMBOL_SIMPLE_INDEX, Symbols, and llvm::objcopy::elf::SectionBase::Type.
Referenced by llvm::objcopy::elf::Object::addNewSymbolTable(), and addSymbol().
|
inlinestatic |
Definition at line 733 of file ELFObject.h.
References llvm::objcopy::elf::SectionBase::OriginalType, and llvm::ELF::SHT_SYMTAB.
|
inline |
Definition at line 710 of file ELFObject.h.
References Symbols.
Referenced by removeUnneededSections(), and replaceAndRemoveSections().
void SymbolTableSection::fillShndxTable | ( | ) |
Definition at line 814 of file ELFObject.cpp.
References llvm::objcopy::elf::SectionIndexSection::addIndex(), SectionIndexTable, llvm::ELF::SHN_LORESERVE, llvm::ELF::SHN_UNDEF, Sym, and Symbols.
|
overridevirtual |
Reimplemented from llvm::objcopy::elf::SectionBase.
Definition at line 785 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::ELF::STB_LOCAL, Sym, SymbolNames, and Symbols.
|
inline |
Definition at line 715 of file ELFObject.h.
References SectionIndexTable.
|
inline |
Definition at line 717 of file ELFObject.h.
References SymbolNames.
Referenced by removeUnneededSections(), and replaceAndRemoveSections().
Definition at line 835 of file ELFObject.cpp.
References getSymbolByIndex(), and Sym.
Definition at line 828 of file ELFObject.cpp.
References llvm::createStringError(), llvm::objcopy::elf::SectionBase::Index, llvm::invalid_argument, and Symbols.
Referenced by getSymbolByIndex(), and initRelocations().
|
inline |
Definition at line 711 of file ELFObject.h.
References IndicesChanged.
|
overridevirtual |
Reimplemented from llvm::objcopy::elf::SectionBase.
Definition at line 769 of file ELFObject.cpp.
References llvm::objcopy::elf::SectionTableRef::getSectionOfType(), llvm::objcopy::elf::SectionBase::Link, llvm::objcopy::elf::SectionBase::Size, and llvm::Expected< T >::takeError().
Referenced by llvm::objcopy::elf::Object::addNewSymbolTable().
void SymbolTableSection::prepareForLayout | ( | ) |
Definition at line 798 of file ELFObject.cpp.
References llvm::objcopy::elf::StringTableSection::addString(), llvm::objcopy::elf::SectionIndexSection::reserve(), SectionIndexTable, Sym, SymbolNames, and Symbols.
|
overridevirtual |
Reimplemented from llvm::objcopy::elf::SectionBase.
Definition at line 722 of file ELFObject.cpp.
References llvm::createStringError(), llvm::invalid_argument, llvm::objcopy::elf::SectionBase::Name, removeSymbols(), SectionIndexTable, Sym, SymbolNames, and ToRemove.
|
overridevirtual |
Reimplemented from llvm::objcopy::elf::SectionBase.
Definition at line 748 of file ELFObject.cpp.
References llvm::objcopy::elf::SectionBase::EntrySize, IndicesChanged, llvm::objcopy::elf::SectionBase::Size, llvm::Error::success(), Sym, Symbols, and ToRemove.
Referenced by removeSectionReferences().
|
overridevirtual |
Reimplemented from llvm::objcopy::elf::SectionBase.
Definition at line 762 of file ELFObject.cpp.
References llvm::DenseMapBase< DerivedT, KeyT, ValueT, KeyInfoT, BucketT >::lookup(), Sym, and Symbols.
|
inline |
Definition at line 712 of file ELFObject.h.
References SectionIndexTable.
Referenced by llvm::objcopy::elf::SectionIndexSection::initialize().
void SymbolTableSection::updateSymbols | ( | function_ref< void(Symbol &)> | Callable | ) |
Definition at line 739 of file ELFObject.cpp.
References llvm::drop_begin(), llvm::ELF::STB_LOCAL, Sym, and Symbols.
Referenced by updateAndRemoveSymbols().
|
protected |
Definition at line 698 of file ELFObject.h.
Referenced by indicesChanged(), and removeSymbols().
|
protected |
Definition at line 697 of file ELFObject.h.
Referenced by fillShndxTable(), getShndxTable(), prepareForLayout(), removeSectionReferences(), and setShndxTable().
|
protected |
Definition at line 696 of file ELFObject.h.
Referenced by finalize(), getStrTab(), prepareForLayout(), and removeSectionReferences().
|
protected |
Definition at line 695 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().