mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-07-28 12:53:53 -06:00
bsd-user: Fix calculation of size to allocate
It was incorrect to subtract off the size of an unsigned int here. In bsd-user fork, this change was made when moving the arch specific items to specific files. The size in BSD that's available for the arguments does not need a return address subtracted from it. Signed-off-by: Warner Losh <imp@bsdimp.com> Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
This commit is contained in:
parent
d37853f92f
commit
223005f058
1 changed files with 2 additions and 3 deletions
|
@ -143,10 +143,9 @@ int loader_exec(const char *filename, char **argv, char **envp,
|
||||||
struct target_pt_regs *regs, struct image_info *infop,
|
struct target_pt_regs *regs, struct image_info *infop,
|
||||||
struct bsd_binprm *bprm)
|
struct bsd_binprm *bprm)
|
||||||
{
|
{
|
||||||
int retval;
|
int retval, i;
|
||||||
int i;
|
|
||||||
|
|
||||||
bprm->p = TARGET_PAGE_SIZE * MAX_ARG_PAGES - sizeof(unsigned int);
|
bprm->p = TARGET_PAGE_SIZE * MAX_ARG_PAGES;
|
||||||
for (i = 0; i < MAX_ARG_PAGES; i++) { /* clear page-table */
|
for (i = 0; i < MAX_ARG_PAGES; i++) { /* clear page-table */
|
||||||
bprm->page[i] = NULL;
|
bprm->page[i] = NULL;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue