Revision 4118a970
b/linux-user/elfload.c | ||
---|---|---|
517 | 517 |
* |
518 | 518 |
*/ |
519 | 519 |
static unsigned long copy_elf_strings(int argc,char ** argv, void **page, |
520 |
unsigned long p)
|
|
520 |
target_ulong p)
|
|
521 | 521 |
{ |
522 | 522 |
char *tmp, *tmp1, *pag = NULL; |
523 | 523 |
int len, offset = 0; |
... | ... | |
544 | 544 |
pag = (char *)page[p/TARGET_PAGE_SIZE]; |
545 | 545 |
if (!pag) { |
546 | 546 |
pag = (char *)malloc(TARGET_PAGE_SIZE); |
547 |
memset(pag, 0, TARGET_PAGE_SIZE); |
|
547 | 548 |
page[p/TARGET_PAGE_SIZE] = pag; |
548 | 549 |
if (!pag) |
549 | 550 |
return 0; |
b/linux-user/mmap.c | ||
---|---|---|
224 | 224 |
start = HOST_PAGE_ALIGN(real_start); |
225 | 225 |
end = start + HOST_PAGE_ALIGN(len); |
226 | 226 |
if (start > real_start) |
227 |
munmap((void *)real_start, start - real_start);
|
|
227 |
munmap((void *)g2h(real_start), start - real_start);
|
|
228 | 228 |
if (end < real_end) |
229 |
munmap((void *)end, real_end - end);
|
|
229 |
munmap((void *)g2h(end), real_end - end);
|
|
230 | 230 |
/* use it as a fixed mapping */ |
231 | 231 |
flags |= MAP_FIXED; |
232 | 232 |
} else { |
... | ... | |
370 | 370 |
|
371 | 371 |
/* unmap what we can */ |
372 | 372 |
if (real_start < real_end) { |
373 |
ret = munmap((void *)real_start, real_end - real_start);
|
|
373 |
ret = munmap(g2h(real_start), real_end - real_start);
|
|
374 | 374 |
if (ret != 0) |
375 | 375 |
return ret; |
376 | 376 |
} |
Also available in: Unified diff