mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-02 23:33:54 -06:00
flatload: fix bss clearing
The current bss clear logic assumes the target mmap address and host address are the same. Use g2h to translate from the target address space to the host so we can call memset on it. Signed-off-by: Mike Frysinger <vapier@gentoo.org> Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
This commit is contained in:
parent
aebf5bc727
commit
cd8e407d24
1 changed files with 1 additions and 1 deletions
|
@ -660,7 +660,7 @@ static int load_flat_file(struct linux_binprm * bprm,
|
|||
}
|
||||
|
||||
/* zero the BSS. */
|
||||
memset((void *)((unsigned long)datapos + data_len), 0, bss_len);
|
||||
memset(g2h(datapos + data_len), 0, bss_len);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue