sim-se: Fix execve syscall
There were three things preventing execve from working
Firstly, the entrypoint for the new program wasn't correct. This was
fixed by calling Process::init, which adds a bias to the entrypoint.
Secondly, the uname string wasn't being copied over. This meant when the
new executable tried to run, it would think the kernel was too old to
run on, and would error out. This was fixed by copying over the uname
string (the `release` string in Process) when creating the new process.
Additionally, this patch also ensures we copy over the uname string in
the clone implementation, as otherwise a cloned thread that called
execve would crash.
Finally, we choose to not delete the new ProcessParams or the old
Process. This is done both because it matches what is done in cloneFunc,
but also because deleting the old process results in a segfault later
Reviewed-by: Matt Sinclair <email@example.com>
Reviewed-by: Bobby R. Bruce <firstname.lastname@example.org>
Maintainer: Matt Sinclair <email@example.com>
Tested-by: kokoro <firstname.lastname@example.org>
1 file changed