*
*/
static unsigned long copy_elf_strings(int argc,char ** argv, void **page,
- unsigned long p)
+ target_ulong p)
{
char *tmp, *tmp1, *pag = NULL;
int len, offset = 0;
pag = (char *)page[p/TARGET_PAGE_SIZE];
if (!pag) {
pag = (char *)malloc(TARGET_PAGE_SIZE);
+ memset(pag, 0, TARGET_PAGE_SIZE);
page[p/TARGET_PAGE_SIZE] = pag;
if (!pag)
return 0;
start = HOST_PAGE_ALIGN(real_start);
end = start + HOST_PAGE_ALIGN(len);
if (start > real_start)
- munmap((void *)real_start, start - real_start);
+ munmap((void *)g2h(real_start), start - real_start);
if (end < real_end)
- munmap((void *)end, real_end - end);
+ munmap((void *)g2h(end), real_end - end);
/* use it as a fixed mapping */
flags |= MAP_FIXED;
} else {
/* unmap what we can */
if (real_start < real_end) {
- ret = munmap((void *)real_start, real_end - real_start);
+ ret = munmap(g2h(real_start), real_end - real_start);
if (ret != 0)
return ret;
}