]> git.proxmox.com Git - mirror_qemu.git/blobdiff - linux-user/elfload.c
tests/test-vmstate.c: add save_buffer util func
[mirror_qemu.git] / linux-user / elfload.c
index 816272aa327faf16e47172a827375423268310ac..547053c27aee2c6206b3618c818c0220f5c73723 100644 (file)
@@ -1842,6 +1842,8 @@ static void load_elf_image(const char *image_name, int image_fd,
     info->pt_dynamic_addr = 0;
 #endif
 
+    mmap_lock();
+
     /* Find the maximum size of the image and allocate an appropriate
        amount of memory to handle that.  */
     loaddr = -1, hiaddr = 0;
@@ -2002,6 +2004,8 @@ static void load_elf_image(const char *image_name, int image_fd,
         load_symbols(ehdr, image_fd, load_bias);
     }
 
+    mmap_unlock();
+
     close(image_fd);
     return;