Răsfoiți Sursa

fix: fix load aarch64 aot failed (#4114)

Co-authored-by: xiangjia.xj <xiangjia.xj@alibaba-inc.com>
jia xiang 1 an în urmă
părinte
comite
73998e4c85
2 a modificat fișierele cu 3 adăugiri și 2 ștergeri
  1. 2 1
      core/iwasm/aot/aot_loader.c
  2. 1 1
      core/iwasm/aot/arch/aot_reloc_aarch64.c

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

@@ -590,7 +590,8 @@ load_target_info_section(const uint8 *buf, const uint8 *buf_end,
     }
 
     /* for backwards compatibility with previous wamrc aot files */
-    if (!strcmp(target_info.arch, "arm64"))
+    if (!strcmp(target_info.arch, "arm64")
+        || !strcmp(target_info.arch, "aarch64"))
         bh_strcpy_s(target_info.arch, sizeof(target_info.arch), "aarch64v8");
 
     /* Check machine info */

+ 1 - 1
core/iwasm/aot/arch/aot_reloc_aarch64.c

@@ -63,7 +63,7 @@ get_current_target(char *target_buf, uint32 target_buf_size)
     /* Set to "aarch64v8" by default if sub version isn't specified */
     if (strcmp(s, "AARCH64") == 0) {
         s = "aarch64v8";
-        s_size = 9; /* strlen("aarch64v8"); */
+        s_size = 10; /* sizeof("aarch64v8"); */
     }
     if (target_buf_size < s_size) {
         s_size = target_buf_size;