Commit 4e080ed8 authored by A. Wilcox's avatar A. Wilcox 🦊 Committed by Sebastian Dröge

PowerPC: Support ELFv2 ABI

The ELFv2 ABI does not use function descriptors.  This change has been
tested on Power Mac G5, IBM POWER6, and Raptor Talos II, all using the
musl libc on Linux kernel 4.14.
parent 7e504fa1
......@@ -418,7 +418,7 @@ orc_powerpc_flush_cache (OrcCode *code)
int size = code->code_size;
ptr = code->code;
#ifdef __powerpc64__
#if defined(__powerpc64__) && (!defined(_CALL_ELF) || _CALL_ELF == 1)
*(unsigned char **) ptr = (unsigned char *) code->exec + 24;
#endif
for (i=0;i<size;i+=cache_line_size) {
......
......@@ -27,12 +27,14 @@ powerpc_emit_prologue (OrcCompiler *compiler)
ORC_ASM_CODE (compiler, "%s:\n", compiler->program->name);
if (compiler->is_64bit) {
#if !defined(_CALL_ELF) || _CALL_ELF == 1
ORC_ASM_CODE (compiler, " .quad .%s,.TOC.@tocbase,0\n",
compiler->program->name);
ORC_ASM_CODE (compiler, ".%s:\n", compiler->program->name);
powerpc_emit (compiler, 0); powerpc_emit (compiler, 0);
powerpc_emit (compiler, 0); powerpc_emit (compiler, 0);
powerpc_emit (compiler, 0); powerpc_emit (compiler, 0);
#endif
powerpc_emit_stdu (compiler, POWERPC_R1, POWERPC_R1, -16);
} else {
powerpc_emit_stwu (compiler, POWERPC_R1, POWERPC_R1, -16);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment