]> Git Repo - qemu.git/commitdiff
flatload: fix bss clearing
authorMike Frysinger <[email protected]>
Mon, 9 Jul 2012 03:04:57 +0000 (03:04 +0000)
committerPeter Maydell <[email protected]>
Tue, 14 Aug 2012 19:26:55 +0000 (20:26 +0100)
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 <[email protected]>
Reviewed-by: Peter Maydell <[email protected]>
Signed-off-by: Peter Maydell <[email protected]>
linux-user/flatload.c

index be794960ccc12e3948c37721facdc415aeb4d21e..58f679e07282acacde4c9ec20eec6c56d79e2b1b 100644 (file)
@@ -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;
 }
This page took 0.023683 seconds and 4 git commands to generate.