qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] flatload: fix bss clearing
@ 2012-07-09 13:04 Mike Frysinger
  2012-07-09 13:11 ` Peter Maydell
  2012-07-09 13:21 ` Andreas Färber
  0 siblings, 2 replies; 4+ messages in thread
From: Mike Frysinger @ 2012-07-09 13:04 UTC (permalink / raw)
  To: qemu-devel; +Cc: Riku Voipio

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>
---
 linux-user/flatload.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/linux-user/flatload.c b/linux-user/flatload.c
index be79496..58f679e 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;
 }
-- 
1.7.7.3

^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2012-07-10  6:00 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-07-09 13:04 [Qemu-devel] [PATCH] flatload: fix bss clearing Mike Frysinger
2012-07-09 13:11 ` Peter Maydell
2012-07-09 13:21 ` Andreas Färber
2012-07-10  5:59   ` Mike Frysinger

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).