gem5
v20.1.0.0
|
#include <elf_object.hh>
Public Member Functions | |
ElfObject (ImageFileDataPtr ifd) | |
~ElfObject () | |
MemoryImage | buildImage () const override |
ObjectFile * | getInterpreter () const override |
std::string | getInterpPath (const GElf_Phdr &phdr) const |
Addr | bias () const override |
bool | relocatable () const override |
Addr | mapSize () const override |
void | updateBias (Addr bias_addr) override |
bool | hasTLS () override |
Addr | programHeaderTable () |
uint16_t | programHeaderSize () |
uint16_t | programHeaderCount () |
Public Member Functions inherited from Loader::ObjectFile | |
virtual | ~ObjectFile () |
Arch | getArch () const |
OpSys | getOpSys () const |
const SymbolTable & | symtab () const |
Addr | entryPoint () const |
Protected Member Functions | |
void | determineArch () |
void | determineOpSys () |
void | handleLoadableSegment (GElf_Phdr phdr, int seg_num) |
bool | loadSomeSymbols (SymbolTable *symtab, int binding, Addr mask, Addr base, Addr offset) |
Helper functions for loadGlobalSymbols() and loadLocalSymbols(). More... | |
void | getSections () |
bool | sectionExists (std::string sec) |
Protected Member Functions inherited from Loader::ObjectFile | |
ObjectFile (ImageFileDataPtr ifd) | |
Protected Member Functions inherited from Loader::ImageFile | |
ImageFile (ImageFileDataPtr data) | |
virtual | ~ImageFile () |
Protected Attributes | |
Elf * | elf |
GElf_Ehdr | ehdr |
Addr | _programHeaderTable = 0 |
uint16_t | _programHeaderSize = 0 |
uint16_t | _programHeaderCount = 0 |
std::set< std::string > | sectionNames |
ElfObject * | interpreter = nullptr |
Addr | ldBias = 0 |
bool | relocate = true |
Addr | ldMin = MaxAddr |
Addr | ldMax = MaxAddr |
MemoryImage | image |
Protected Attributes inherited from Loader::ObjectFile | |
Arch | arch = UnknownArch |
OpSys | opSys = UnknownOpSys |
SymbolTable | _symtab |
Addr | entry = 0 |
Protected Attributes inherited from Loader::ImageFile | |
ImageFileDataPtr | imageData |
Definition at line 59 of file elf_object.hh.
Loader::ElfObject::ElfObject | ( | ImageFileDataPtr | ifd | ) |
Definition at line 105 of file elf_object.cc.
References _programHeaderCount, _programHeaderSize, Loader::ObjectFile::_symtab, Loader::Symbol::address, Loader::Symbol::binding, X86ISA::count, Loader::createObjectFile(), data, determineArch(), determineOpSys(), DPRINTF, DPRINTFR, ehdr, elf, Loader::ObjectFile::entry, getInterpPath(), Loader::Symbol::Global, handleLoadableSegment(), ArmISA::i, image, Loader::ImageFile::imageData, Loader::SymbolTable::insert(), interpreter, Loader::Symbol::Local, Loader::Symbol::name, panic, X86ISA::seg, Loader::MemoryImage::segments(), Loader::ObjectFile::symtab(), warn_if, and Loader::Symbol::Weak.
Loader::ElfObject::~ElfObject | ( | ) |
Definition at line 354 of file elf_object.cc.
References elf.
|
inlineoverridevirtual |
Reimplemented from Loader::ObjectFile.
Definition at line 112 of file elf_object.hh.
References ldBias.
|
inlineoverridevirtual |
|
protected |
Definition at line 217 of file elf_object.cc.
References Loader::ObjectFile::arch, Loader::Arm, Loader::Arm64, bits(), ehdr, fatal, Loader::I386, Loader::Mips, Loader::Power, Loader::Riscv32, Loader::Riscv64, Loader::SPARC32, Loader::SPARC64, Loader::Thumb, warn, and Loader::X86_64.
Referenced by ElfObject().
|
protected |
Definition at line 264 of file elf_object.cc.
References ehdr, elf, fatal, Loader::FreeBSD, htobe(), htole(), Loader::Linux, Loader::LinuxArmOABI, Loader::ObjectFile::opSys, Loader::Solaris, Loader::Tru64, and Loader::UnknownOpSys.
Referenced by ElfObject().
std::string Loader::ElfObject::getInterpPath | ( | const GElf_Phdr & | phdr | ) | const |
Definition at line 206 of file elf_object.cc.
References Loader::ImageFile::imageData.
Referenced by ElfObject().
|
inlineoverridevirtual |
Reimplemented from Loader::ObjectFile.
Definition at line 109 of file elf_object.hh.
References interpreter.
|
protected |
Definition at line 360 of file elf_object.cc.
References ehdr, elf, Loader::ImageFile::imageData, panic, and sectionNames.
Referenced by sectionExists().
|
protected |
Definition at line 327 of file elf_object.cc.
References _programHeaderTable, Loader::MemoryImage::addSegment(), ehdr, image, Loader::ImageFile::imageData, name(), and sc_dt::to_string().
Referenced by ElfObject().
|
inlineoverridevirtual |
Reimplemented from Loader::ObjectFile.
Definition at line 117 of file elf_object.hh.
References sectionExists().
|
protected |
Helper functions for loadGlobalSymbols() and loadLocalSymbols().
|
inlineoverridevirtual |
Reimplemented from Loader::ObjectFile.
Definition at line 114 of file elf_object.hh.
|
inline |
Definition at line 121 of file elf_object.hh.
References _programHeaderCount.
|
inline |
Definition at line 120 of file elf_object.hh.
References _programHeaderSize.
|
inline |
Definition at line 119 of file elf_object.hh.
References _programHeaderTable.
|
inlineoverridevirtual |
Reimplemented from Loader::ObjectFile.
Definition at line 113 of file elf_object.hh.
References relocate.
|
protected |
Definition at line 396 of file elf_object.cc.
References getSections(), and sectionNames.
Referenced by hasTLS().
|
overridevirtual |
Reimplemented from Loader::ObjectFile.
Definition at line 406 of file elf_object.cc.
References Loader::ObjectFile::entry, image, ldBias, and Loader::MemoryImage::offset().
|
protected |
Definition at line 73 of file elf_object.hh.
Referenced by ElfObject(), and programHeaderCount().
|
protected |
Definition at line 72 of file elf_object.hh.
Referenced by ElfObject(), and programHeaderSize().
|
protected |
Definition at line 71 of file elf_object.hh.
Referenced by handleLoadableSegment(), and programHeaderTable().
|
protected |
Definition at line 63 of file elf_object.hh.
Referenced by determineArch(), determineOpSys(), ElfObject(), getSections(), and handleLoadableSegment().
|
protected |
Definition at line 62 of file elf_object.hh.
Referenced by determineOpSys(), ElfObject(), getSections(), and ~ElfObject().
|
protected |
Definition at line 101 of file elf_object.hh.
Referenced by buildImage(), ElfObject(), handleLoadableSegment(), and updateBias().
|
protected |
Definition at line 76 of file elf_object.hh.
Referenced by ElfObject(), and getInterpreter().
|
protected |
Definition at line 81 of file elf_object.hh.
Referenced by bias(), and updateBias().
Definition at line 92 of file elf_object.hh.
Referenced by mapSize().
Definition at line 91 of file elf_object.hh.
Referenced by mapSize().
|
protected |
Definition at line 87 of file elf_object.hh.
Referenced by relocatable().
|
protected |
Definition at line 74 of file elf_object.hh.
Referenced by getSections(), and sectionExists().