wasm-micro-runtime/core/iwasm/aot
dongsheng28849455 4f6d70bc52
Use indirect call in pre-checker function to avoid relocation in XIP mode (#3142)
The stack profiler `aot_func#xxx` calls the wrapped function of `aot_func_internal#xxx`
by using symbol reference,  but in some platform like xtensa, it’s translated into a native
long call, which needs to resolve the indirect address by relocation and breaks the XIP
feature which requires the eliminating of relocation.

The solution is to change the symbol reference into an indirect call through the lookup
table, the code will be like this:
```llvm
call_wrapped_func:                                ; preds = %stack_bound_check_block
  %func_addr1 = getelementptr inbounds ptr, ptr %func_ptrs_ptr, i32 75
  %func_tmp2 = load ptr, ptr %func_addr1, align 4
  tail call void %func_tmp2(ptr %exec_env)
  ret void
```
2024-02-27 11:17:57 +08:00
..
arch aot_reloc_x86_64.c: Suggest to try --size-level=0 as well (#3067) 2024-01-23 13:00:19 +08:00
debug Fix aot large model (--size-level=0) with LLVM 18 (#3057) 2024-01-19 19:43:41 +08:00
aot_intrinsic.c Add "--enable-builtin-intrinsics=<flags>" option to wamrc (#2341) 2023-07-06 18:20:35 +08:00
aot_intrinsic.h Implement i32.div_s (#1792) 2022-12-13 10:48:51 +08:00
aot_loader.c Use indirect call in pre-checker function to avoid relocation in XIP mode (#3142) 2024-02-27 11:17:57 +08:00
aot_reloc.h Implement GC (Garbage Collection) feature for interpreter, AOT and LLVM-JIT (#3125) 2024-02-06 20:47:11 +08:00
aot_runtime.c Use indirect call in pre-checker function to avoid relocation in XIP mode (#3142) 2024-02-27 11:17:57 +08:00
aot_runtime.h Implement GC (Garbage Collection) feature for interpreter, AOT and LLVM-JIT (#3125) 2024-02-06 20:47:11 +08:00
iwasm_aot.cmake Fix windows AOT hw bound check (#2475) 2023-08-18 10:16:03 +08:00
SConscript Add ia32 support and fix compiling issue for RT-Thread (#730) 2021-09-07 10:20:14 +08:00