summaryrefslogtreecommitdiffstats
path: root/linux-user
diff options
context:
space:
mode:
authorMike Frysinger2012-07-09 05:04:57 +0200
committerPeter Maydell2012-08-14 21:26:55 +0200
commitcd8e407d24657569e0d6e323b2e8c274fafab590 (patch)
treecd85c9af014cc639e32a851293ed1eefcebf2e09 /linux-user
parentlinux-user: make host_to_target_cmsg support SO_TIMESTAMP cmsg_type (diff)
downloadqemu-cd8e407d24657569e0d6e323b2e8c274fafab590.tar.gz
qemu-cd8e407d24657569e0d6e323b2e8c274fafab590.tar.xz
qemu-cd8e407d24657569e0d6e323b2e8c274fafab590.zip
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>
Diffstat (limited to 'linux-user')
-rw-r--r--linux-user/flatload.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/linux-user/flatload.c b/linux-user/flatload.c
index be794960cc..58f679e072 100644
--- a/linux-user/flatload.c
+++ b/linux-user/flatload.c
@@ -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;
}