gem5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Classes | Public Types | Public Member Functions | Static Public Attributes | Protected Member Functions | Protected Attributes | List of all members
ObjectFile Class Referenceabstract

#include <object_file.hh>

Inheritance diagram for ObjectFile:
AoutObject DtbObject EcoffObject ElfObject RawObject

Classes

struct  Section
 

Public Types

enum  Arch {
  UnknownArch, Alpha, SPARC64, SPARC32,
  Mips, X86_64, I386, Arm64,
  Arm, Thumb, Power, Riscv
}
 
enum  OpSys {
  UnknownOpSys, Tru64, Linux, Solaris,
  LinuxArmOABI, FreeBSD
}
 

Public Member Functions

virtual ~ObjectFile ()
 
virtual bool loadSections (PortProxy &mem_proxy, Addr mask=maxAddr, Addr offset=0)
 
virtual bool loadAllSymbols (SymbolTable *symtab, Addr base=0, Addr offset=0, Addr mask=maxAddr)=0
 
virtual bool loadGlobalSymbols (SymbolTable *symtab, Addr base=0, Addr offset=0, Addr mask=maxAddr)=0
 
virtual bool loadLocalSymbols (SymbolTable *symtab, Addr base=0, Addr offset=0, Addr mask=maxAddr)=0
 
virtual bool loadWeakSymbols (SymbolTable *symtab, Addr base=0, Addr offset=0, Addr mask=maxAddr)
 
virtual ObjectFilegetInterpreter () const
 
virtual bool relocatable () const
 
virtual Addr mapSize () const
 
virtual void updateBias (Addr bias_addr)
 
virtual Addr bias () const
 
virtual bool hasTLS ()
 
Arch getArch () const
 
OpSys getOpSys () const
 
Addr entryPoint () const
 
Addr globalPointer () const
 
Addr textBase () const
 
Addr dataBase () const
 
Addr bssBase () const
 
size_t textSize () const
 
size_t dataSize () const
 
size_t bssSize () const
 
void setTextBase (Addr a)
 

Static Public Attributes

static const Addr maxAddr = std::numeric_limits<Addr>::max()
 

Protected Member Functions

 ObjectFile (const std::string &_filename, size_t _len, uint8_t *_data, Arch _arch, OpSys _opSys)
 
bool loadSection (Section *sec, PortProxy &mem_proxy, Addr mask, Addr offset=0)
 
void setGlobalPointer (Addr global_ptr)
 

Protected Attributes

const std::string filename
 
uint8_t * fileData
 
size_t len
 
Arch arch
 
OpSys opSys
 
Addr entry
 
Addr globalPtr
 
Section text
 
Section data
 
Section bss
 

Detailed Description

Definition at line 44 of file object_file.hh.

Member Enumeration Documentation

Enumerator
UnknownArch 
Alpha 
SPARC64 
SPARC32 
Mips 
X86_64 
I386 
Arm64 
Arm 
Thumb 
Power 
Riscv 

Definition at line 48 of file object_file.hh.

Enumerator
UnknownOpSys 
Tru64 
Linux 
Solaris 
LinuxArmOABI 
FreeBSD 

Definition at line 63 of file object_file.hh.

Constructor & Destructor Documentation

ObjectFile::ObjectFile ( const std::string &  _filename,
size_t  _len,
uint8_t *  _data,
Arch  _arch,
OpSys  _opSys 
)
protected

Definition at line 55 of file object_file.cc.

ObjectFile::~ObjectFile ( )
virtual

Definition at line 65 of file object_file.cc.

References fileData, and len.

Member Function Documentation

virtual Addr ObjectFile::bias ( ) const
inlinevirtual

Reimplemented in ElfObject.

Definition at line 107 of file object_file.hh.

Referenced by Process::getBias().

Addr ObjectFile::bssBase ( ) const
inline

Definition at line 140 of file object_file.hh.

References ObjectFile::Section::baseAddr, and bss.

Referenced by RiscvProcess::RiscvProcess(), and System::System().

size_t ObjectFile::bssSize ( ) const
inline
Addr ObjectFile::dataBase ( ) const
inline
size_t ObjectFile::dataSize ( ) const
inline
Addr ObjectFile::entryPoint ( ) const
inline
Arch ObjectFile::getArch ( ) const
inline

Definition at line 111 of file object_file.hh.

References arch.

Referenced by ArmSystem::ArmSystem(), ArmSystem::getBootLoader(), and X86System::initState().

virtual ObjectFile* ObjectFile::getInterpreter ( ) const
inlinevirtual

Reimplemented in ElfObject.

Definition at line 101 of file object_file.hh.

Referenced by Process::getInterpreter(), and Process::updateBias().

OpSys ObjectFile::getOpSys ( ) const
inline
Addr ObjectFile::globalPointer ( ) const
inline

Definition at line 136 of file object_file.hh.

References globalPtr.

Referenced by AlphaProcess::initState().

virtual bool ObjectFile::hasTLS ( )
inlinevirtual

Reimplemented in ElfObject.

Definition at line 109 of file object_file.hh.

virtual bool ObjectFile::loadAllSymbols ( SymbolTable symtab,
Addr  base = 0,
Addr  offset = 0,
Addr  mask = maxAddr 
)
pure virtual

Implemented in ElfObject, DtbObject, EcoffObject, AoutObject, and RawObject.

Referenced by mmapImpl().

virtual bool ObjectFile::loadGlobalSymbols ( SymbolTable symtab,
Addr  base = 0,
Addr  offset = 0,
Addr  mask = maxAddr 
)
pure virtual
virtual bool ObjectFile::loadLocalSymbols ( SymbolTable symtab,
Addr  base = 0,
Addr  offset = 0,
Addr  mask = maxAddr 
)
pure virtual
bool ObjectFile::loadSection ( Section sec,
PortProxy mem_proxy,
Addr  mask,
Addr  offset = 0 
)
protected
bool ObjectFile::loadSections ( PortProxy mem_proxy,
Addr  mask = maxAddr,
Addr  offset = 0 
)
virtual
virtual bool ObjectFile::loadWeakSymbols ( SymbolTable symtab,
Addr  base = 0,
Addr  offset = 0,
Addr  mask = maxAddr 
)
inlinevirtual

Reimplemented in ElfObject.

Definition at line 97 of file object_file.hh.

Referenced by Process::Process().

virtual Addr ObjectFile::mapSize ( ) const
inlinevirtual

Reimplemented in ElfObject.

Definition at line 103 of file object_file.hh.

References panic.

Referenced by Process::updateBias().

virtual bool ObjectFile::relocatable ( ) const
inlinevirtual

Reimplemented in ElfObject.

Definition at line 102 of file object_file.hh.

Referenced by Process::updateBias().

void ObjectFile::setGlobalPointer ( Addr  global_ptr)
inlineprotected

Definition at line 131 of file object_file.hh.

References globalPtr.

void ObjectFile::setTextBase ( Addr  a)
inline
Addr ObjectFile::textBase ( ) const
inline

Definition at line 138 of file object_file.hh.

References ObjectFile::Section::baseAddr, and text.

Referenced by AlphaProcess::AlphaProcess(), mmapImpl(), and System::System().

size_t ObjectFile::textSize ( ) const
inline

Definition at line 142 of file object_file.hh.

References ObjectFile::Section::size, and text.

Referenced by mmapImpl().

virtual void ObjectFile::updateBias ( Addr  bias_addr)
inlinevirtual

Reimplemented in ElfObject.

Definition at line 105 of file object_file.hh.

References panic.

Referenced by Process::updateBias().

Member Data Documentation

Arch ObjectFile::arch
protected

Definition at line 77 of file object_file.hh.

Referenced by getArch(), and ElfObject::tryFile().

Section ObjectFile::bss
protected
Section ObjectFile::data
protected
Addr ObjectFile::entry
protected
uint8_t* ObjectFile::fileData
protected
const std::string ObjectFile::filename
protected
Addr ObjectFile::globalPtr
protected

Definition at line 123 of file object_file.hh.

Referenced by globalPointer(), and setGlobalPointer().

size_t ObjectFile::len
protected
const Addr ObjectFile::maxAddr = std::numeric_limits<Addr>::max()
static

Definition at line 86 of file object_file.hh.

OpSys ObjectFile::opSys
protected

Definition at line 78 of file object_file.hh.

Referenced by getOpSys().

Section ObjectFile::text
protected

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

Generated on Fri Jun 9 2017 13:04:16 for gem5 by doxygen 1.8.6