aot_reloc_x86_64.c: Suggest to try --size-level=0 as well (#3067)

cf. https://github.com/bytecodealliance/wasm-micro-runtime/issues/3035
This commit is contained in:
YAMAMOTO Takashi 2024-01-23 14:00:19 +09:00 committed by GitHub
parent c8b59588a7
commit b44aa654b8
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -163,7 +163,7 @@ apply_relocation(AOTModule *module, uint8 *target_section_addr,
error_buf, error_buf_size, error_buf, error_buf_size,
"AOT module load failed: " "AOT module load failed: "
"relocation truncated to fit R_X86_64_PC32 failed. " "relocation truncated to fit R_X86_64_PC32 failed. "
"Try using wamrc with --size-level=1 option."); "Try using wamrc with --size-level=1 or 0 option.");
return false; return false;
} }
@ -196,7 +196,7 @@ apply_relocation(AOTModule *module, uint8 *target_section_addr,
snprintf(buf, sizeof(buf), snprintf(buf, sizeof(buf),
"AOT module load failed: " "AOT module load failed: "
"relocation truncated to fit %s failed. " "relocation truncated to fit %s failed. "
"Try using wamrc with --size-level=1 option.", "Try using wamrc with --size-level=1 or 0 option.",
reloc_type == R_X86_64_32 ? "R_X86_64_32" reloc_type == R_X86_64_32 ? "R_X86_64_32"
: "R_X86_64_32S"); : "R_X86_64_32S");
set_error_buf(error_buf, error_buf_size, buf); set_error_buf(error_buf, error_buf_size, buf);
@ -236,7 +236,8 @@ apply_relocation(AOTModule *module, uint8 *target_section_addr,
target_addr -= sizeof(int32); target_addr -= sizeof(int32);
#endif #endif
if ((int32)target_addr != target_addr) { if ((int32)target_addr != target_addr) {
set_error_buf(error_buf, error_buf_size, set_error_buf(
error_buf, error_buf_size,
"AOT module load failed: " "AOT module load failed: "
"relocation truncated to fit " "relocation truncated to fit "
#if !defined(BH_PLATFORM_WINDOWS) #if !defined(BH_PLATFORM_WINDOWS)
@ -244,7 +245,7 @@ apply_relocation(AOTModule *module, uint8 *target_section_addr,
#else #else
"IMAGE_REL_AMD64_32 failed." "IMAGE_REL_AMD64_32 failed."
#endif #endif
"Try using wamrc with --size-level=1 option."); "Try using wamrc with --size-level=1 or 0 option.");
return false; return false;
} }
*(int32 *)(target_section_addr + reloc_offset) = (int32)target_addr; *(int32 *)(target_section_addr + reloc_offset) = (int32)target_addr;