seanbruno/qemu-bsd-user — pull request #6 by akabaev (2014-07-06 13:21:23+00:00)
Title: Follow exec_copyout_strings more closely when setting up guest stack.

Remove mysterious TARGET_SPACE_USRSPACE define that limited the
compined size of argvp and envp vectors to just 4k and use the same
calculation that FreeBSD kernel uses to allocate the space for
strings and vectors sans aux vector, which we do not support just
yet. Remove assumption that argv and env strings end up at the top
of the stack and pass the pointer around instead.

This allows one to run programs with more than 4096/sizeof(abi_long)
env and args strings on command line.