forked from JuliaLang/julia
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix trampoline on PPC (JuliaLang#38980)
* [Make] Normalize ppc64le to powerpc64le * [CLI] Fix trampoline on PowerPC 1. Add global entry 2. Don't store `r2` on parent frame 3. Conservative load from toc * remove jl_compile_extern_c from exported funcs
- Loading branch information
Showing
4 changed files
with
30 additions
and
15 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
#include "../../src/jl_exported_funcs.inc" | ||
|
||
// Notes: | ||
// bctr: branch to CTR without LR update (tail-call) | ||
// localentry: On PPC functions have a localentry that assumes r2 contains | ||
// the TOC pointer, and a global entry point that sets r2. | ||
// See 64-Bit ELF V2 ABI Specification: Power Architecture v1.4 | ||
|
||
#define XX(name) \ | ||
.global name; \ | ||
.type name##, @function; \ | ||
.cfi_startproc; \ | ||
name##: ; \ | ||
addis 2, 12, .TOC.-name##@ha; \ | ||
addi 2, 2, .TOC.-name##@l; \ | ||
.localentry name##,.-name##; \ | ||
addis 9,2,name##_addr@toc@ha; \ | ||
ld 12,name##_addr@toc@l(9); \ | ||
mtctr 12; \ | ||
bctr; \ | ||
.cfi_endproc; \ | ||
.size name##,.-name##; \ | ||
|
||
JL_EXPORTED_FUNCS(XX) | ||
#undef XX |
This file was deleted.
Oops, something went wrong.
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