wasm-micro-runtime/core/iwasm
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
..
aot Use indirect call in pre-checker function to avoid relocation in XIP mode (#3142) 2024-02-27 11:17:57 +08:00
common Fix inconsistent coding convention (#3171) 2024-02-22 10:40:50 +08:00
compilation Use indirect call in pre-checker function to avoid relocation in XIP mode (#3142) 2024-02-27 11:17:57 +08:00
doc Add architecture diagram for wasm globals and classic-interp stack frame (#2058) 2023-03-25 09:39:20 +08:00
fast-jit Fix llvm jit push funcref/externref result type issue (#3169) 2024-02-21 12:15:18 +08:00
include Implement GC (Garbage Collection) feature for interpreter, AOT and LLVM-JIT (#3125) 2024-02-06 20:47:11 +08:00
interpreter Fix ref.func opcode check when GC is enabled (#3181) 2024-02-27 09:31:19 +08:00
libraries Clarify how to verify SGX evidence without an Intel SGX-enabled platform (#3158) 2024-02-17 18:44:22 +08:00
README.md Add architecture diagram for wasm globals and classic-interp stack frame (#2058) 2023-03-25 09:39:20 +08:00