154a155,166
> void
> I386LiveProcess::syscall(int64_t callnum, ThreadContext *tc)
> {
> Addr eip = tc->readPC();
> if (eip >= vsyscallPage.base &&
> eip < vsyscallPage.base + vsyscallPage.size) {
> tc->setNextPC(vsyscallPage.base + vsyscallPage.vsysexitOffset);
> }
> X86LiveProcess::syscall(callnum, tc);
> }
>
>
160c172,173
< stack_base = (Addr)0xffffe000ULL;
---
> _gdtStart = 0x100000000;
> _gdtSize = VMPageSize;
161a175,181
> vsyscallPage.base = 0xffffe000ULL;
> vsyscallPage.size = VMPageSize;
> vsyscallPage.vsyscallOffset = 0x400;
> vsyscallPage.vsysexitOffset = 0x410;
>
> stack_base = vsyscallPage.base;
>
258,259d277
< _gdtStart = stack_base;
< _gdtSize = VMPageSize;
267a286,306
> // Set up the vsyscall page for this process.
> pTable->allocate(vsyscallPage.base, vsyscallPage.size);
> uint8_t vsyscallBlob[] = {
> 0x51, // push %ecx
> 0x52, // push %edp
> 0x55, // push %ebp
> 0x89, 0xe5, // mov %esp, %ebp
> 0x0f, 0x34 // sysenter
> };
> initVirtMem->writeBlob(vsyscallPage.base + vsyscallPage.vsyscallOffset,
> vsyscallBlob, sizeof(vsyscallBlob));
>
> uint8_t vsysexitBlob[] = {
> 0x5d, // pop %ebp
> 0x5a, // pop %edx
> 0x59, // pop %ecx
> 0xc3 // ret
> };
> initVirtMem->writeBlob(vsyscallPage.base + vsyscallPage.vsysexitOffset,
> vsysexitBlob, sizeof(vsysexitBlob));
>
335c374,375
< X86LiveProcess::argsInit(int pageSize)
---
> X86LiveProcess::argsInit(int pageSize,
> std::vector<AuxVector<IntType> > extraAuxvs)
340c380
< std::vector<auxv_t> auxv;
---
> std::vector<auxv_t> auxv = extraAuxvs;
611c651,652
< X86LiveProcess::argsInit<uint64_t>(pageSize);
---
> std::vector<AuxVector<uint64_t> > extraAuxvs;
> X86LiveProcess::argsInit<uint64_t>(pageSize, extraAuxvs);
617c658,663
< X86LiveProcess::argsInit<uint32_t>(pageSize);
---
> std::vector<AuxVector<uint32_t> > extraAuxvs;
> //Tell the binary where the vsyscall part of the vsyscall page is.
> extraAuxvs.push_back(AuxVector<uint32_t>(0x20,
> vsyscallPage.base + vsyscallPage.vsyscallOffset));
> extraAuxvs.push_back(AuxVector<uint32_t>(0x21, vsyscallPage.base));
> X86LiveProcess::argsInit<uint32_t>(pageSize, extraAuxvs);