gem5 v24.0.0.0
Loading...
Searching...
No Matches
gem5::loader::ElfObject Class Reference

#include <elf_object.hh>

Inheritance diagram for gem5::loader::ElfObject:
gem5::loader::ObjectFile gem5::loader::ImageFile

Public Member Functions

 ElfObject (ImageFileDataPtr ifd)
 
 ~ElfObject ()
 
MemoryImage buildImage () const override
 
ObjectFilegetInterpreter () 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 SymbolTablesymtab () 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
 
ElfObjectinterpreter = 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
 

Detailed Description

Definition at line 63 of file elf_object.hh.

Constructor & Destructor Documentation

◆ ElfObject()

◆ ~ElfObject()

gem5::loader::ElfObject::~ElfObject ( )

Definition at line 406 of file elf_object.cc.

References elf.

Member Function Documentation

◆ bias()

Addr gem5::loader::ElfObject::bias ( ) const
inlineoverridevirtual

Reimplemented from gem5::loader::ObjectFile.

Definition at line 117 of file elf_object.hh.

References ldBias.

◆ buildImage()

MemoryImage gem5::loader::ElfObject::buildImage ( ) const
inlineoverridevirtual

Implements gem5::loader::ImageFile.

Definition at line 112 of file elf_object.hh.

References image.

◆ determineArch()

◆ determineByteOrder()

void gem5::loader::ElfObject::determineByteOrder ( )
protected

Definition at line 365 of file elf_object.cc.

References gem5::loader::ObjectFile::byteOrder, ehdr, and panic.

Referenced by ElfObject().

◆ determineOpSys()

◆ getInterpPath()

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().

◆ getInterpreter()

ObjectFile * gem5::loader::ElfObject::getInterpreter ( ) const
inlineoverridevirtual

Reimplemented from gem5::loader::ObjectFile.

Definition at line 114 of file elf_object.hh.

References interpreter.

◆ getSections()

void gem5::loader::ElfObject::getSections ( )
protected

Definition at line 412 of file elf_object.cc.

References ehdr, elf, gem5::loader::ImageFile::imageData, panic, and sectionNames.

Referenced by sectionExists().

◆ handleLoadableSegment()

void gem5::loader::ElfObject::handleLoadableSegment ( GElf_Phdr phdr,
int seg_num )
protected

◆ hasTLS()

bool gem5::loader::ElfObject::hasTLS ( )
inlineoverridevirtual

Reimplemented from gem5::loader::ObjectFile.

Definition at line 122 of file elf_object.hh.

References sectionExists().

◆ loadSomeSymbols()

bool gem5::loader::ElfObject::loadSomeSymbols ( SymbolTable * symtab,
int binding,
Addr mask,
Addr base,
Addr offset )
protected

Helper functions for loadGlobalSymbols() and loadLocalSymbols().

◆ mapSize()

Addr gem5::loader::ElfObject::mapSize ( ) const
inlineoverridevirtual

Reimplemented from gem5::loader::ObjectFile.

Definition at line 119 of file elf_object.hh.

References ldMax, and ldMin.

◆ programHeaderCount()

uint16_t gem5::loader::ElfObject::programHeaderCount ( )
inline

Definition at line 126 of file elf_object.hh.

References _programHeaderCount.

◆ programHeaderSize()

uint16_t gem5::loader::ElfObject::programHeaderSize ( )
inline

Definition at line 125 of file elf_object.hh.

References _programHeaderSize.

◆ programHeaderTable()

Addr gem5::loader::ElfObject::programHeaderTable ( )
inline

Definition at line 124 of file elf_object.hh.

References _programHeaderTable.

◆ relocatable()

bool gem5::loader::ElfObject::relocatable ( ) const
inlineoverridevirtual

Reimplemented from gem5::loader::ObjectFile.

Definition at line 118 of file elf_object.hh.

References relocate.

◆ sectionExists()

bool gem5::loader::ElfObject::sectionExists ( std::string sec)
protected

Definition at line 448 of file elf_object.cc.

References getSections(), and sectionNames.

Referenced by hasTLS().

◆ updateBias()

void gem5::loader::ElfObject::updateBias ( Addr bias_addr)
overridevirtual

Member Data Documentation

◆ _programHeaderCount

uint16_t gem5::loader::ElfObject::_programHeaderCount = 0
protected

Definition at line 78 of file elf_object.hh.

Referenced by ElfObject(), and programHeaderCount().

◆ _programHeaderSize

uint16_t gem5::loader::ElfObject::_programHeaderSize = 0
protected

Definition at line 77 of file elf_object.hh.

Referenced by ElfObject(), and programHeaderSize().

◆ _programHeaderTable

Addr gem5::loader::ElfObject::_programHeaderTable = 0
protected

Definition at line 76 of file elf_object.hh.

Referenced by handleLoadableSegment(), and programHeaderTable().

◆ ehdr

GElf_Ehdr gem5::loader::ElfObject::ehdr
protected

◆ elf

Elf* gem5::loader::ElfObject::elf
protected

Definition at line 66 of file elf_object.hh.

Referenced by determineOpSys(), ElfObject(), getSections(), and ~ElfObject().

◆ image

MemoryImage gem5::loader::ElfObject::image
protected

Definition at line 106 of file elf_object.hh.

Referenced by buildImage(), ElfObject(), handleLoadableSegment(), and updateBias().

◆ interpreter

ElfObject* gem5::loader::ElfObject::interpreter = nullptr
protected

Definition at line 81 of file elf_object.hh.

Referenced by ElfObject(), and getInterpreter().

◆ ldBias

Addr gem5::loader::ElfObject::ldBias = 0
protected

Definition at line 86 of file elf_object.hh.

Referenced by bias(), and updateBias().

◆ ldMax

Addr gem5::loader::ElfObject::ldMax = MaxAddr
protected

Definition at line 97 of file elf_object.hh.

Referenced by mapSize().

◆ ldMin

Addr gem5::loader::ElfObject::ldMin = MaxAddr
protected

Definition at line 96 of file elf_object.hh.

Referenced by mapSize().

◆ relocate

bool gem5::loader::ElfObject::relocate = true
protected

Definition at line 92 of file elf_object.hh.

Referenced by relocatable().

◆ sectionNames

std::set<std::string> gem5::loader::ElfObject::sectionNames
protected

Definition at line 79 of file elf_object.hh.

Referenced by getSections(), and sectionExists().


The documentation for this class was generated from the following files:

Generated on Tue Jun 18 2024 16:24:19 for gem5 by doxygen 1.11.0