diff options
Diffstat (limited to 'src/arch/sparc/process.cc')
-rw-r--r-- | src/arch/sparc/process.cc | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/src/arch/sparc/process.cc b/src/arch/sparc/process.cc index 8c8be65ab..09d52ae6b 100644 --- a/src/arch/sparc/process.cc +++ b/src/arch/sparc/process.cc @@ -203,6 +203,9 @@ SparcLiveProcess::argsInit(int pageSize) // maintain double word alignment of the stack pointer. uint64_t align = 16; + // Patch the ld_bias for dynamic executables. + updateBias(); + // load object file into target memory objFile->loadSections(initVirtMem); @@ -245,10 +248,10 @@ SparcLiveProcess::argsInit(int pageSize) auxv.push_back(auxv_t(M5_AT_PHENT, elfObject->programHeaderSize())); // This is the number of program headers from the original elf file. auxv.push_back(auxv_t(M5_AT_PHNUM, elfObject->programHeaderCount())); - // This is the address of the elf "interpreter", It should be set - // to 0 for regular executables. It should be something else - // (not sure what) for dynamic libraries. - auxv.push_back(auxv_t(M5_AT_BASE, 0)); + // 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())); // This is hardwired to 0 in the elf loading code in the kernel auxv.push_back(auxv_t(M5_AT_FLAGS, 0)); // The entry point to the program @@ -402,7 +405,7 @@ SparcLiveProcess::argsInit(int pageSize) // don't have anything like that, it should be set to 0. tc->setIntReg(1, 0); - tc->pcState(objFile->entryPoint()); + tc->pcState(getStartPC()); // Align the "stack_min" to a page boundary. stack_min = roundDown(stack_min, pageSize); |