Enable windows x86-32 AOT relocations (#2285)

Implement relocation types IMAGE_REL_I386_DIR32 and IMAGE_REL_I386_REL32,
fix failure to find AOT function symbol, and implement symbol __aulldiv.
This commit is contained in:
Wenyong Huang
2023-06-16 11:48:12 +08:00
committed by GitHub
parent efaf37c577
commit 0ac5f206b8
2 changed files with 40 additions and 4 deletions

View File

@ -1996,6 +1996,20 @@ do_text_relocation(AOTModule *module, AOTRelocationGroup *group,
symbol_addr = module->func_ptrs[func_index];
#endif
}
#if defined(BH_PLATFORM_WINDOWS) && defined(BUILD_TARGET_X86_32)
/* AOT function name starts with '_' in windows x86-32 */
else if (!strncmp(symbol, "_" AOT_FUNC_PREFIX,
strlen("_" AOT_FUNC_PREFIX))) {
p = symbol + strlen("_" AOT_FUNC_PREFIX);
if (*p == '\0'
|| (func_index = (uint32)atoi(p)) > module->func_count) {
set_error_buf_v(error_buf, error_buf_size, "invalid symbol %s",
symbol);
goto check_symbol_fail;
}
symbol_addr = module->func_ptrs[func_index];
}
#endif
else if (!strcmp(symbol, ".text")) {
symbol_addr = module->code;
}