提交 cd8e407d 编写于 作者: M Mike Frysinger 提交者: Peter Maydell

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: NMike Frysinger <vapier@gentoo.org>
Reviewed-by: NPeter Maydell <peter.maydell@linaro.org>
Signed-off-by: NPeter Maydell <peter.maydell@linaro.org>
上级 aebf5bc7
......@@ -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;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册