-
Notifications
You must be signed in to change notification settings - Fork 639
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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 ```
- Loading branch information
1 parent
2349df1
commit 4f6d70b
Showing
4 changed files
with
132 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters