XIP adaptation for xtensa platform (#1636)

Add macro WASM_ENABLE_WORD_ALING_READ to enable reading
1/2/4 and n bytes data from vram buffer, which requires 4-byte addr
alignment reading.

Eliminate XIP AOT relocations related to the below ones:
   i32_div_u, f32_min, f32_max, f32_ceil, f32_floor, f32_trunc, f32_rint
This commit is contained in:
dongsheng28849455
2022-10-31 17:25:24 +08:00
committed by GitHub
parent dba9e52f2f
commit e517dbc7b2
10 changed files with 244 additions and 11 deletions

View File

@ -506,6 +506,10 @@ wasm_runtime_full_init(RuntimeInitArgs *init_args)
PackageType
get_package_type(const uint8 *buf, uint32 size)
{
#if (WASM_ENABLE_WORD_ALIGN_READ != 0)
uint32 buf32 = *(uint32 *)buf;
buf = (const uint8 *)&buf32;
#endif
if (buf && size >= 4) {
if (buf[0] == '\0' && buf[1] == 'a' && buf[2] == 's' && buf[3] == 'm')
return Wasm_Module_Bytecode;