summaryrefslogtreecommitdiff
path: root/src/arch/alpha
diff options
context:
space:
mode:
authorBrandon Potter <brandon.potter@amd.com>2016-03-17 10:31:03 -0700
committerBrandon Potter <brandon.potter@amd.com>2016-03-17 10:31:03 -0700
commit9b4249410ec18cac9df2c7e9c0a4a6ce5459233d (patch)
treec3260ef4f23b9eca7d835ab1e0dfc8ce1173b17c /src/arch/alpha
parent4fc69db8f89049a881a5f4aa68545840818b124c (diff)
downloadgem5-9b4249410ec18cac9df2c7e9c0a4a6ce5459233d.tar.xz
base: support dynamic loading of Linux ELF objects in SE mode
Diffstat (limited to 'src/arch/alpha')
-rw-r--r--src/arch/alpha/process.cc9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/arch/alpha/process.cc b/src/arch/alpha/process.cc
index 54ef338f3..9e298f0c6 100644
--- a/src/arch/alpha/process.cc
+++ b/src/arch/alpha/process.cc
@@ -67,6 +67,9 @@ AlphaLiveProcess::AlphaLiveProcess(LiveProcessParams *params,
void
AlphaLiveProcess::argsInit(int intSize, int pageSize)
{
+ // Patch the ld_bias for dynamic executables.
+ updateBias();
+
objFile->loadSections(initVirtMem);
typedef AuxVector<uint64_t> auxv_t;
@@ -88,6 +91,10 @@ AlphaLiveProcess::argsInit(int intSize, int pageSize)
auxv.push_back(auxv_t(M5_AT_PHDR, elfObject->programHeaderTable()));
DPRINTF(Loader, "auxv at PHDR %08p\n", elfObject->programHeaderTable());
auxv.push_back(auxv_t(M5_AT_PHNUM, elfObject->programHeaderCount()));
+ // This is the base address of the ELF interpreter; it should be
+ // zero for static executables or contain the base address for
+ // dynamic executables.
+ auxv.push_back(auxv_t(M5_AT_BASE, getBias()));
auxv.push_back(auxv_t(M5_AT_ENTRY, objFile->entryPoint()));
auxv.push_back(auxv_t(M5_AT_UID, uid()));
auxv.push_back(auxv_t(M5_AT_EUID, euid()));
@@ -163,7 +170,7 @@ AlphaLiveProcess::argsInit(int intSize, int pageSize)
setSyscallArg(tc, 1, argv_array_base);
tc->setIntReg(StackPointerReg, stack_min);
- tc->pcState(objFile->entryPoint());
+ tc->pcState(getStartPC());
}
void