flatload: fix bss clearing
PATCH 1/1 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.
--- linux-user/flatload.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
linux-user/flatload.c +1 -1
@@ -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 ; }
Signature · 1 line
1.7.7.3
Quoted 5 lines · Mike Frysinger
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]>
-- PMM
Hi Mike,
Am 09.07.2012 15:04, schrieb Mike Frysinger:
Quoted 8 lines
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]>--- linux-user/flatload.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
Patch looks sensible. Are you working on rebasing your Blackfin target to QOM and AREG0?
Cheers,
Andreas
Signature · 2 lines
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer; HRB 16746 AG Nürnberg
Quoted 7 lines · On Monday 09 July 2012 09:21:52 Andreas Färber wrote:
Am 09.07.2012 15:04, schrieb Mike Frysinger:
Quoted 3 lines
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.
Patch looks sensible. Are you working on rebasing your Blackfin target to QOM and AREG0?
i've rebased them to the latest release (1.1.0). FDPIC seems to work fine, as does basic ELF, but FLAT gets into an infinite loop and i haven't figured out why just yet.
-mike