gem5  v20.1.0.0
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
Loader::ElfObject Class Reference

#include <elf_object.hh>

Inheritance diagram for Loader::ElfObject:
Loader::ObjectFile 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 Loader::ObjectFile
virtual ~ObjectFile ()
 
Arch getArch () const
 
OpSys getOpSys () const
 
const SymbolTablesymtab () 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
 
ElfObjectinterpreter = 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
 

Detailed Description

Definition at line 59 of file elf_object.hh.

Constructor & Destructor Documentation

◆ ElfObject()

Loader::ElfObject::ElfObject ( ImageFileDataPtr  ifd)

◆ ~ElfObject()

Loader::ElfObject::~ElfObject ( )

Definition at line 354 of file elf_object.cc.

References elf.

Member Function Documentation

◆ bias()

Addr Loader::ElfObject::bias ( ) const
inlineoverridevirtual

Reimplemented from Loader::ObjectFile.

Definition at line 112 of file elf_object.hh.

References ldBias.

◆ buildImage()

MemoryImage Loader::ElfObject::buildImage ( ) const
inlineoverridevirtual

Implements Loader::ImageFile.

Definition at line 107 of file elf_object.hh.

References image.

◆ determineArch()

void Loader::ElfObject::determineArch ( )
protected

◆ determineOpSys()

void Loader::ElfObject::determineOpSys ( )
protected

◆ getInterpPath()

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

◆ getInterpreter()

ObjectFile* Loader::ElfObject::getInterpreter ( ) const
inlineoverridevirtual

Reimplemented from Loader::ObjectFile.

Definition at line 109 of file elf_object.hh.

References interpreter.

◆ getSections()

void Loader::ElfObject::getSections ( )
protected

Definition at line 360 of file elf_object.cc.

References ehdr, elf, Loader::ImageFile::imageData, panic, and sectionNames.

Referenced by sectionExists().

◆ handleLoadableSegment()

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

◆ hasTLS()

bool Loader::ElfObject::hasTLS ( )
inlineoverridevirtual

Reimplemented from Loader::ObjectFile.

Definition at line 117 of file elf_object.hh.

References sectionExists().

◆ loadSomeSymbols()

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

Helper functions for loadGlobalSymbols() and loadLocalSymbols().

◆ mapSize()

Addr Loader::ElfObject::mapSize ( ) const
inlineoverridevirtual

Reimplemented from Loader::ObjectFile.

Definition at line 114 of file elf_object.hh.

References ldMax, and ldMin.

◆ programHeaderCount()

uint16_t Loader::ElfObject::programHeaderCount ( )
inline

Definition at line 121 of file elf_object.hh.

References _programHeaderCount.

◆ programHeaderSize()

uint16_t Loader::ElfObject::programHeaderSize ( )
inline

Definition at line 120 of file elf_object.hh.

References _programHeaderSize.

◆ programHeaderTable()

Addr Loader::ElfObject::programHeaderTable ( )
inline

Definition at line 119 of file elf_object.hh.

References _programHeaderTable.

◆ relocatable()

bool Loader::ElfObject::relocatable ( ) const
inlineoverridevirtual

Reimplemented from Loader::ObjectFile.

Definition at line 113 of file elf_object.hh.

References relocate.

◆ sectionExists()

bool Loader::ElfObject::sectionExists ( std::string  sec)
protected

Definition at line 396 of file elf_object.cc.

References getSections(), and sectionNames.

Referenced by hasTLS().

◆ updateBias()

void Loader::ElfObject::updateBias ( Addr  bias_addr)
overridevirtual

Reimplemented from Loader::ObjectFile.

Definition at line 406 of file elf_object.cc.

References Loader::ObjectFile::entry, image, ldBias, and Loader::MemoryImage::offset().

Member Data Documentation

◆ _programHeaderCount

uint16_t Loader::ElfObject::_programHeaderCount = 0
protected

Definition at line 73 of file elf_object.hh.

Referenced by ElfObject(), and programHeaderCount().

◆ _programHeaderSize

uint16_t Loader::ElfObject::_programHeaderSize = 0
protected

Definition at line 72 of file elf_object.hh.

Referenced by ElfObject(), and programHeaderSize().

◆ _programHeaderTable

Addr Loader::ElfObject::_programHeaderTable = 0
protected

Definition at line 71 of file elf_object.hh.

Referenced by handleLoadableSegment(), and programHeaderTable().

◆ ehdr

GElf_Ehdr Loader::ElfObject::ehdr
protected

◆ elf

Elf* Loader::ElfObject::elf
protected

Definition at line 62 of file elf_object.hh.

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

◆ image

MemoryImage Loader::ElfObject::image
protected

Definition at line 101 of file elf_object.hh.

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

◆ interpreter

ElfObject* Loader::ElfObject::interpreter = nullptr
protected

Definition at line 76 of file elf_object.hh.

Referenced by ElfObject(), and getInterpreter().

◆ ldBias

Addr Loader::ElfObject::ldBias = 0
protected

Definition at line 81 of file elf_object.hh.

Referenced by bias(), and updateBias().

◆ ldMax

Addr Loader::ElfObject::ldMax = MaxAddr
protected

Definition at line 92 of file elf_object.hh.

Referenced by mapSize().

◆ ldMin

Addr Loader::ElfObject::ldMin = MaxAddr
protected

Definition at line 91 of file elf_object.hh.

Referenced by mapSize().

◆ relocate

bool Loader::ElfObject::relocate = true
protected

Definition at line 87 of file elf_object.hh.

Referenced by relocatable().

◆ sectionNames

std::set<std::string> Loader::ElfObject::sectionNames
protected

Definition at line 74 of file elf_object.hh.

Referenced by getSections(), and sectionExists().


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

Generated on Wed Sep 30 2020 14:03:06 for gem5 by doxygen 1.8.17