+ /* XXX: this is really a hack : if the real host page size is
+ smaller than the target page size, some pages after the end
+ of the file may not be mapped. A better fix would be to
+ patch target_mmap(), but it is more complicated as the file
+ size must be known */
+ if (real_host_page_size < host_page_size) {
+ unsigned long end_addr, end_addr1;
+ end_addr1 = (elf_bss + real_host_page_size - 1) &
+ ~(real_host_page_size - 1);
+ end_addr = HOST_PAGE_ALIGN(elf_bss);
+ if (end_addr1 < end_addr) {
+ mmap((void *)end_addr1, end_addr - end_addr1,
+ PROT_READ|PROT_WRITE|PROT_EXEC,
+ MAP_FIXED|MAP_PRIVATE|MAP_ANONYMOUS, -1, 0);
+ }
+ }
+
+ nbyte = elf_bss & (host_page_size-1);