Răsfoiți Sursa

Fix aot code failed to run on darwin/android issue (#599)

Wenyong Huang 4 ani în urmă
părinte
comite
fe76c89c25
1 a modificat fișierele cu 3 adăugiri și 1 ștergeri
  1. 3 1
      core/iwasm/aot/aot_loader.c

+ 3 - 1
core/iwasm/aot/aot_loader.c

@@ -1838,7 +1838,7 @@ load_relocation_section(const uint8 *buf, const uint8 *buf_end,
     }
 
     /* Set read only for AOT code and some data sections */
-    map_prot = MMAP_PROT_READ;
+    map_prot = MMAP_PROT_READ | MMAP_PROT_EXEC;
 
     if (module->code) {
         /* The layout is: literal size + literal + code (with plt table) */
@@ -1848,6 +1848,8 @@ load_relocation_section(const uint8 *buf, const uint8 *buf_end,
         os_mprotect(mmap_addr, total_size, map_prot);
     }
 
+    map_prot = MMAP_PROT_READ;
+
 #if defined(BH_PLATFORM_WINDOWS)
     if (module->extra_plt_data) {
         os_mprotect(module->extra_plt_data, module->extra_plt_data_size,