gem5 v24.0.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 gem5::loader::ObjectFile | |
virtual | ~ObjectFile () |
Arch | getArch () const |
OpSys | getOpSys () const |
ByteOrder | getByteOrder () const |
const SymbolTable & | symtab () const |
Addr | entryPoint () const |
Protected Member Functions | |
void | determineArch () |
void | determineOpSys () |
void | determineByteOrder () |
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(). | |
void | getSections () |
bool | sectionExists (std::string sec) |
Protected Member Functions inherited from gem5::loader::ObjectFile | |
ObjectFile (ImageFileDataPtr ifd) | |
Protected Member Functions inherited from gem5::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 gem5::loader::ObjectFile | |
Arch | arch = UnknownArch |
OpSys | opSys = UnknownOpSys |
ByteOrder | byteOrder = ByteOrder::little |
SymbolTable | _symtab |
Addr | entry = 0 |
Protected Attributes inherited from gem5::loader::ImageFile | |
ImageFileDataPtr | imageData |
Definition at line 63 of file elf_object.hh.
gem5::loader::ElfObject::ElfObject | ( | ImageFileDataPtr | ifd | ) |
Definition at line 109 of file elf_object.cc.
References _programHeaderCount, _programHeaderSize, gem5::loader::ObjectFile::_symtab, gem5::loader::Symbol::address(), gem5::X86ISA::count, gem5::loader::createObjectFile(), data, determineArch(), determineByteOrder(), determineOpSys(), DPRINTF, DPRINTFR, ehdr, elf, gem5::loader::ObjectFile::entry, gem5::loader::Symbol::File, gem5::loader::Symbol::Function, getInterpPath(), gem5::loader::Symbol::Global, handleLoadableSegment(), gem5::ArmISA::i, image, gem5::loader::ImageFile::imageData, gem5::loader::SymbolTable::insert(), interpreter, gem5::loader::Symbol::Local, gem5::loader::Symbol::name(), gem5::loader::Symbol::NoType, gem5::loader::Symbol::Object, gem5::loader::Symbol::Other, panic, gem5::loader::Symbol::Section, gem5::X86ISA::seg, gem5::loader::MemoryImage::segments(), gem5::loader::ObjectFile::symtab(), warn_if, and gem5::loader::Symbol::Weak.
gem5::loader::ElfObject::~ElfObject | ( | ) |
Definition at line 406 of file elf_object.cc.
References elf.
|
inlineoverridevirtual |
Reimplemented from gem5::loader::ObjectFile.
Definition at line 117 of file elf_object.hh.
References ldBias.
|
inlineoverridevirtual |
|
protected |
Definition at line 247 of file elf_object.cc.
References gem5::loader::ObjectFile::arch, gem5::loader::Arm, gem5::loader::Arm64, gem5::bits(), ehdr, fatal, gem5::loader::I386, gem5::loader::Mips, gem5::loader::Power, gem5::loader::Power64, gem5::loader::Riscv32, gem5::loader::Riscv64, gem5::loader::SPARC32, gem5::loader::SPARC64, gem5::loader::Thumb, warn, and gem5::loader::X86_64.
Referenced by ElfObject().
|
protected |
Definition at line 365 of file elf_object.cc.
References gem5::loader::ObjectFile::byteOrder, ehdr, and panic.
Referenced by ElfObject().
|
protected |
Definition at line 287 of file elf_object.cc.
References ehdr, elf, fatal, gem5::loader::FreeBSD, gem5::htobe(), gem5::htole(), gem5::loader::Linux, gem5::loader::LinuxArmOABI, gem5::loader::LinuxPower64ABIv1, gem5::loader::LinuxPower64ABIv2, gem5::loader::ObjectFile::opSys, gem5::loader::Solaris, gem5::loader::Tru64, and gem5::loader::UnknownOpSys.
Referenced by ElfObject().
std::string gem5::loader::ElfObject::getInterpPath | ( | const GElf_Phdr & | phdr | ) | const |
Definition at line 236 of file elf_object.cc.
References gem5::loader::ImageFile::imageData.
Referenced by ElfObject().
|
inlineoverridevirtual |
Reimplemented from gem5::loader::ObjectFile.
Definition at line 114 of file elf_object.hh.
References interpreter.
|
protected |
Definition at line 412 of file elf_object.cc.
References ehdr, elf, gem5::loader::ImageFile::imageData, panic, and sectionNames.
Referenced by sectionExists().
|
protected |
Definition at line 374 of file elf_object.cc.
References _programHeaderTable, gem5::loader::MemoryImage::addSegment(), ehdr, image, gem5::loader::ImageFile::imageData, name(), and warn.
Referenced by ElfObject().
|
inlineoverridevirtual |
Reimplemented from gem5::loader::ObjectFile.
Definition at line 122 of file elf_object.hh.
References sectionExists().
|
protected |
Helper functions for loadGlobalSymbols() and loadLocalSymbols().
|
inlineoverridevirtual |
Reimplemented from gem5::loader::ObjectFile.
Definition at line 119 of file elf_object.hh.
|
inline |
Definition at line 126 of file elf_object.hh.
References _programHeaderCount.
|
inline |
Definition at line 125 of file elf_object.hh.
References _programHeaderSize.
|
inline |
Definition at line 124 of file elf_object.hh.
References _programHeaderTable.
|
inlineoverridevirtual |
Reimplemented from gem5::loader::ObjectFile.
Definition at line 118 of file elf_object.hh.
References relocate.
|
protected |
Definition at line 448 of file elf_object.cc.
References getSections(), and sectionNames.
Referenced by hasTLS().
|
overridevirtual |
Reimplemented from gem5::loader::ObjectFile.
Definition at line 458 of file elf_object.cc.
References gem5::loader::ObjectFile::entry, image, ldBias, and gem5::loader::MemoryImage::offset().
|
protected |
Definition at line 78 of file elf_object.hh.
Referenced by ElfObject(), and programHeaderCount().
|
protected |
Definition at line 77 of file elf_object.hh.
Referenced by ElfObject(), and programHeaderSize().
|
protected |
Definition at line 76 of file elf_object.hh.
Referenced by handleLoadableSegment(), and programHeaderTable().
|
protected |
Definition at line 67 of file elf_object.hh.
Referenced by determineArch(), determineByteOrder(), determineOpSys(), ElfObject(), getSections(), and handleLoadableSegment().
|
protected |
Definition at line 66 of file elf_object.hh.
Referenced by determineOpSys(), ElfObject(), getSections(), and ~ElfObject().
|
protected |
Definition at line 106 of file elf_object.hh.
Referenced by buildImage(), ElfObject(), handleLoadableSegment(), and updateBias().
|
protected |
Definition at line 81 of file elf_object.hh.
Referenced by ElfObject(), and getInterpreter().
|
protected |
Definition at line 86 of file elf_object.hh.
Referenced by bias(), and updateBias().
Definition at line 97 of file elf_object.hh.
Referenced by mapSize().
Definition at line 96 of file elf_object.hh.
Referenced by mapSize().
|
protected |
Definition at line 92 of file elf_object.hh.
Referenced by relocatable().
|
protected |
Definition at line 79 of file elf_object.hh.
Referenced by getSections(), and sectionExists().