From 9b4249410ec18cac9df2c7e9c0a4a6ce5459233d Mon Sep 17 00:00:00 2001 From: Brandon Potter Date: Thu, 17 Mar 2016 10:31:03 -0700 Subject: base: support dynamic loading of Linux ELF objects in SE mode --- src/arch/alpha/process.cc | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'src/arch/alpha') 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 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 -- cgit v1.2.3