gem5  v21.1.0.2
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
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(). More...
 
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 64 of file elf_object.hh.

Constructor & Destructor Documentation

◆ ElfObject()

gem5::loader::ElfObject::ElfObject ( ImageFileDataPtr  ifd)

◆ ~ElfObject()

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

Definition at line 382 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 118 of file elf_object.hh.

References ldBias.

◆ buildImage()

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

Implements gem5::loader::ImageFile.

Definition at line 113 of file elf_object.hh.

References image.

◆ determineArch()

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

◆ determineByteOrder()

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

Definition at line 341 of file elf_object.cc.

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

Referenced by ElfObject().

◆ determineOpSys()

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

◆ getInterpPath()

std::string gem5::loader::ElfObject::getInterpPath ( const GElf_Phdr &  phdr) const

Definition at line 212 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 115 of file elf_object.hh.

References interpreter.

◆ getSections()

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

Definition at line 388 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 123 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 120 of file elf_object.hh.

References ldMax, and ldMin.

◆ programHeaderCount()

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

Definition at line 127 of file elf_object.hh.

References _programHeaderCount.

◆ programHeaderSize()

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

Definition at line 126 of file elf_object.hh.

References _programHeaderSize.

◆ programHeaderTable()

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

Definition at line 125 of file elf_object.hh.

References _programHeaderTable.

◆ relocatable()

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

Reimplemented from gem5::loader::ObjectFile.

Definition at line 119 of file elf_object.hh.

References relocate.

◆ sectionExists()

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

Definition at line 424 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 79 of file elf_object.hh.

Referenced by ElfObject(), and programHeaderCount().

◆ _programHeaderSize

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

Definition at line 78 of file elf_object.hh.

Referenced by ElfObject(), and programHeaderSize().

◆ _programHeaderTable

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

Definition at line 77 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 67 of file elf_object.hh.

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

◆ image

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

Definition at line 107 of file elf_object.hh.

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

◆ interpreter

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

Definition at line 82 of file elf_object.hh.

Referenced by ElfObject(), and getInterpreter().

◆ ldBias

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

Definition at line 87 of file elf_object.hh.

Referenced by bias(), and updateBias().

◆ ldMax

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

Definition at line 98 of file elf_object.hh.

Referenced by mapSize().

◆ ldMin

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

Definition at line 97 of file elf_object.hh.

Referenced by mapSize().

◆ relocate

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

Definition at line 93 of file elf_object.hh.

Referenced by relocatable().

◆ sectionNames

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

Definition at line 80 of file elf_object.hh.

Referenced by getSections(), and sectionExists().


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

Generated on Tue Sep 21 2021 12:31:27 for gem5 by doxygen 1.8.17