@@ -302,7 +302,10 @@ loader_mmap(uint32 size, bool prot_exec, char *error_buf, uint32 error_buf_size)
302302 int map_flags ;
303303 void * mem ;
304304
305- #if UINTPTR_MAX == UINT64_MAX
305+ #if defined(BUILD_TARGET_X86_64 ) || defined(BUILD_TARGET_AMD_64 ) \
306+ || defined(BUILD_TARGET_RISCV64_LP64D ) \
307+ || defined(BUILD_TARGET_RISCV64_LP64 )
308+ #ifndef __APPLE__
306309 /* The mmapped AOT data and code in 64-bit targets had better be in
307310 range 0 to 2G, or aot loader may fail to apply some relocations,
308311 e.g., R_X86_64_32/R_X86_64_32S/R_X86_64_PC32/R_RISCV_32.
@@ -316,6 +319,7 @@ loader_mmap(uint32 size, bool prot_exec, char *error_buf, uint32 error_buf_size)
316319 bh_assert ((uintptr_t )mem < INT32_MAX );
317320 return mem ;
318321 }
322+ #endif
319323#endif
320324
321325 map_flags = MMAP_MAP_NONE ;
@@ -579,6 +583,10 @@ load_target_info_section(const uint8 *buf, const uint8 *buf_end,
579583 return false;
580584 }
581585
586+ /* for backwards compatibility with previous wamrc aot files */
587+ if (!strcmp (target_info .arch , "arm64" ))
588+ bh_strcpy_s (target_info .arch , sizeof (target_info .arch ), "aarch64v8" );
589+
582590 /* Check machine info */
583591 if (!check_machine_info (& target_info , error_buf , error_buf_size )) {
584592 return false;
@@ -589,6 +597,10 @@ load_target_info_section(const uint8 *buf, const uint8 *buf_end,
589597 return false;
590598 }
591599
600+ #if WASM_ENABLE_DUMP_CALL_STACK != 0
601+ module -> feature_flags = target_info .feature_flags ;
602+ #endif
603+
592604 /* Finally, check feature flags */
593605 return check_feature_flags (error_buf , error_buf_size ,
594606 target_info .feature_flags );
0 commit comments