LLVM 20.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 | |
Public Attributes inherited from llvm::objcopy::elf::SectionBase | |
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 807 of file ELFObject.h.
|
protected |
Definition at line 819 of file ELFObject.h.
|
inline |
Definition at line 822 of file ELFObject.h.
References llvm::objcopy::elf::SectionBase::OriginalType, and llvm::ELF::SHT_SYMTAB.
|
overridevirtual |
Implements llvm::objcopy::elf::SectionBase.
Definition at line 885 of file ELFObject.cpp.
References llvm::objcopy::elf::MutableSectionVisitor::visit().
|
overridevirtual |
Implements llvm::objcopy::elf::SectionBase.
Definition at line 881 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 717 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 852 of file ELFObject.h.
References llvm::objcopy::elf::SectionBase::OriginalType, and llvm::ELF::SHT_SYMTAB.
|
inline |
Definition at line 829 of file ELFObject.h.
References Symbols.
Referenced by removeUnneededSections(), and replaceAndRemoveSections().
void SymbolTableSection::fillShndxTable | ( | ) |
Definition at line 834 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 805 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 834 of file ELFObject.h.
References SectionIndexTable.
|
inline |
Definition at line 836 of file ELFObject.h.
References SymbolNames.
Referenced by removeUnneededSections(), and replaceAndRemoveSections().
Definition at line 855 of file ELFObject.cpp.
References getSymbolByIndex(), and Sym.
Definition at line 848 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 830 of file ELFObject.h.
References IndicesChanged.
|
overridevirtual |
Reimplemented from llvm::objcopy::elf::SectionBase.
Definition at line 789 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().
Referenced by llvm::objcopy::elf::Object::addNewSymbolTable().
void SymbolTableSection::prepareForLayout | ( | ) |
Definition at line 818 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 742 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 768 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 782 of file ELFObject.cpp.
References llvm::DenseMapBase< DerivedT, KeyT, ValueT, KeyInfoT, BucketT >::lookup(), Sym, and Symbols.
|
inline |
Definition at line 831 of file ELFObject.h.
References SectionIndexTable.
Referenced by llvm::objcopy::elf::SectionIndexSection::initialize().
void SymbolTableSection::updateSymbols | ( | function_ref< void(Symbol &)> | Callable | ) |
Definition at line 759 of file ELFObject.cpp.
References llvm::drop_begin(), llvm::ELF::STB_LOCAL, Sym, and Symbols.
Referenced by updateAndRemoveSymbols().
|
protected |
Definition at line 817 of file ELFObject.h.
Referenced by indicesChanged(), and removeSymbols().
|
protected |
Definition at line 816 of file ELFObject.h.
Referenced by fillShndxTable(), getShndxTable(), prepareForLayout(), removeSectionReferences(), and setShndxTable().
|
protected |
Definition at line 815 of file ELFObject.h.
Referenced by finalize(), getStrTab(), prepareForLayout(), and removeSectionReferences().
|
protected |
Definition at line 814 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().