|
gem5
|
#include <object_file.hh>
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 ObjectFile * | getInterpreter () 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 |
Definition at line 44 of file object_file.hh.
| enum ObjectFile::Arch |
| Enumerator | |
|---|---|
| UnknownArch | |
| Alpha | |
| SPARC64 | |
| SPARC32 | |
| Mips | |
| X86_64 | |
| I386 | |
| Arm64 | |
| Arm | |
| Thumb | |
| Power | |
| Riscv | |
Definition at line 48 of file object_file.hh.
| enum ObjectFile::OpSys |
| Enumerator | |
|---|---|
| UnknownOpSys | |
| Tru64 | |
| Linux | |
| Solaris | |
| LinuxArmOABI | |
| FreeBSD | |
Definition at line 63 of file object_file.hh.
|
protected |
Definition at line 55 of file object_file.cc.
|
virtual |
Definition at line 65 of file object_file.cc.
|
inlinevirtual |
Reimplemented in ElfObject.
Definition at line 107 of file object_file.hh.
Referenced by Process::getBias().
|
inline |
Definition at line 140 of file object_file.hh.
References ObjectFile::Section::baseAddr, and bss.
Referenced by RiscvProcess::RiscvProcess(), and System::System().
|
inline |
Definition at line 144 of file object_file.hh.
References bss, and ObjectFile::Section::size.
Referenced by AlphaProcess::AlphaProcess(), ArmProcess32::ArmProcess32(), ArmProcess64::ArmProcess64(), X86ISA::I386Process::I386Process(), MipsProcess::MipsProcess(), PowerProcess::PowerProcess(), RiscvProcess::RiscvProcess(), Sparc32Process::Sparc32Process(), Sparc64Process::Sparc64Process(), System::System(), and X86ISA::X86_64Process::X86_64Process().
|
inline |
Definition at line 139 of file object_file.hh.
References ObjectFile::Section::baseAddr, and data.
Referenced by AlphaProcess::AlphaProcess(), ArmProcess32::ArmProcess32(), ArmProcess64::ArmProcess64(), X86ISA::I386Process::I386Process(), MipsProcess::MipsProcess(), PowerProcess::PowerProcess(), Sparc32Process::Sparc32Process(), Sparc64Process::Sparc64Process(), and X86ISA::X86_64Process::X86_64Process().
|
inline |
Definition at line 143 of file object_file.hh.
References data, and ObjectFile::Section::size.
Referenced by AlphaProcess::AlphaProcess(), ArmProcess32::ArmProcess32(), ArmProcess64::ArmProcess64(), X86ISA::I386Process::I386Process(), MipsProcess::MipsProcess(), PowerProcess::PowerProcess(), Sparc32Process::Sparc32Process(), Sparc64Process::Sparc64Process(), and X86ISA::X86_64Process::X86_64Process().
|
inline |
Definition at line 134 of file object_file.hh.
References entry.
Referenced by AlphaProcess::argsInit(), MipsProcess::argsInit(), PowerProcess::argsInit(), RiscvProcess::argsInit(), SparcProcess::argsInit(), ArmProcess::argsInit(), X86ISA::X86Process::argsInit(), Process::getStartPC(), ArmSystem::initState(), and System::System().
|
inline |
Definition at line 111 of file object_file.hh.
References arch.
Referenced by ArmSystem::ArmSystem(), ArmSystem::getBootLoader(), and X86System::initState().
|
inlinevirtual |
Reimplemented in ElfObject.
Definition at line 101 of file object_file.hh.
Referenced by Process::getInterpreter(), and Process::updateBias().
|
inline |
Definition at line 112 of file object_file.hh.
References opSys.
Referenced by ArmProcess::argsInit(), ArmProcess32::setSyscallReturn(), and ArmProcess64::setSyscallReturn().
|
inline |
Definition at line 136 of file object_file.hh.
References globalPtr.
Referenced by AlphaProcess::initState().
|
inlinevirtual |
Reimplemented in ElfObject.
Definition at line 109 of file object_file.hh.
|
pure virtual |
Implemented in ElfObject, DtbObject, EcoffObject, AoutObject, and RawObject.
Referenced by mmapImpl().
|
pure virtual |
Implemented in ElfObject, DtbObject, EcoffObject, AoutObject, and RawObject.
Referenced by AlphaSystem::AlphaSystem(), ArmSystem::ArmSystem(), FreebsdArmSystem::initState(), LinuxArmSystem::initState(), main(), Process::Process(), SparcSystem::SparcSystem(), and System::System().
|
pure virtual |
Implemented in ElfObject, DtbObject, EcoffObject, AoutObject, and RawObject.
Referenced by AlphaSystem::AlphaSystem(), main(), Process::Process(), SparcSystem::SparcSystem(), and System::System().
|
protected |
Definition at line 75 of file object_file.cc.
References addr, ObjectFile::Section::baseAddr, ObjectFile::Section::fileImage, PortProxy::memsetBlob(), ObjectFile::Section::size, and PortProxy::writeBlob().
Referenced by loadSections(), and ElfObject::loadSections().
|
virtual |
Reimplemented in ElfObject.
Definition at line 93 of file object_file.cc.
References bss, data, loadSection(), and text.
Referenced by AlphaProcess::argsInit(), MipsProcess::argsInit(), PowerProcess::argsInit(), RiscvProcess::argsInit(), SparcProcess::argsInit(), ArmProcess::argsInit(), X86ISA::X86Process::argsInit(), SparcSystem::initState(), AlphaSystem::initState(), FreebsdArmSystem::initState(), LinuxArmSystem::initState(), ArmSystem::initState(), System::initState(), and ElfObject::loadSections().
|
inlinevirtual |
Reimplemented in ElfObject.
Definition at line 97 of file object_file.hh.
Referenced by Process::Process().
|
inlinevirtual |
Reimplemented in ElfObject.
Definition at line 103 of file object_file.hh.
References panic.
Referenced by Process::updateBias().
|
inlinevirtual |
Reimplemented in ElfObject.
Definition at line 102 of file object_file.hh.
Referenced by Process::updateBias().
|
inlineprotected |
Definition at line 131 of file object_file.hh.
References globalPtr.
|
inline |
Definition at line 151 of file object_file.hh.
References ArmISA::a, ObjectFile::Section::baseAddr, and text.
Referenced by SparcSystem::initState(), FreebsdArmSystem::initState(), and LinuxArmSystem::initState().
|
inline |
Definition at line 138 of file object_file.hh.
References ObjectFile::Section::baseAddr, and text.
Referenced by AlphaProcess::AlphaProcess(), mmapImpl(), and System::System().
|
inline |
Definition at line 142 of file object_file.hh.
References ObjectFile::Section::size, and text.
Referenced by mmapImpl().
|
inlinevirtual |
Reimplemented in ElfObject.
Definition at line 105 of file object_file.hh.
References panic.
Referenced by Process::updateBias().
|
protected |
Definition at line 77 of file object_file.hh.
Referenced by getArch(), and ElfObject::tryFile().
|
protected |
Definition at line 127 of file object_file.hh.
Referenced by AoutObject::AoutObject(), bssBase(), bssSize(), DtbObject::DtbObject(), EcoffObject::EcoffObject(), ElfObject::ElfObject(), loadSections(), RawObject::RawObject(), and ElfObject::updateBias().
|
protected |
Definition at line 126 of file object_file.hh.
Referenced by AoutObject::AoutObject(), dataBase(), dataSize(), DtbObject::DtbObject(), EcoffObject::EcoffObject(), ElfObject::ElfObject(), loadSections(), ElfObject::loadSomeSymbols(), RawObject::RawObject(), and ElfObject::updateBias().
|
protected |
Definition at line 122 of file object_file.hh.
Referenced by AoutObject::AoutObject(), EcoffObject::EcoffObject(), ElfObject::ElfObject(), entryPoint(), EcoffObject::loadGlobalSymbols(), EcoffObject::loadLocalSymbols(), and ElfObject::updateBias().
|
protected |
Definition at line 74 of file object_file.hh.
Referenced by DtbObject::addBootCmdLine(), AoutObject::AoutObject(), DtbObject::DtbObject(), EcoffObject::EcoffObject(), ElfObject::ElfObject(), DtbObject::findReleaseAddr(), ElfObject::getSections(), EcoffObject::loadGlobalSymbols(), EcoffObject::loadLocalSymbols(), ElfObject::loadSomeSymbols(), RawObject::RawObject(), DtbObject::~DtbObject(), and ~ObjectFile().
|
protected |
Definition at line 73 of file object_file.hh.
Referenced by ElfObject::ElfObject(), EcoffObject::loadGlobalSymbols(), and EcoffObject::loadLocalSymbols().
|
protected |
Definition at line 123 of file object_file.hh.
Referenced by globalPointer(), and setGlobalPointer().
|
protected |
Definition at line 75 of file object_file.hh.
Referenced by DtbObject::addBootCmdLine(), DtbObject::DtbObject(), ElfObject::ElfObject(), DtbObject::findReleaseAddr(), ElfObject::getSections(), ElfObject::loadSomeSymbols(), RawObject::RawObject(), DtbObject::~DtbObject(), and ~ObjectFile().
Definition at line 86 of file object_file.hh.
|
protected |
Definition at line 78 of file object_file.hh.
Referenced by getOpSys().
|
protected |
Definition at line 125 of file object_file.hh.
Referenced by DtbObject::addBootCmdLine(), AoutObject::AoutObject(), DtbObject::DtbObject(), EcoffObject::EcoffObject(), ElfObject::ElfObject(), loadSections(), RawObject::RawObject(), setTextBase(), textBase(), textSize(), and ElfObject::updateBias().