| ... | ... | @@ -116,6 +116,21 @@ fn _start() callconv(.Naked) noreturn { |
| 116 | 116 | : [argc] "=r" (-> [*]usize) |
| 117 | 117 | ); |
| 118 | 118 | }, |
| 119 | .powerpc64le => { |
| 120 | // Before returning the stack pointer, we have to set up a backchain |
| 121 | // and a few other registers required by the ELFv2 ABI. |
| 122 | // TODO: Support powerpc64 (big endian) on ELFv2. |
| 123 | starting_stack_ptr = asm ( |
| 124 | \\ mr 4, 1 |
| 125 | \\ subi 1, 1, 32 |
| 126 | \\ li 5, 0 |
| 127 | \\ std 5, 0(1) |
| 128 | \\ mr %[argc], 4 |
| 129 | : [argc] "=r" (-> [*]usize) |
| 130 | : |
| 131 | : "r4", "r5" |
| 132 | ); |
| 133 | }, |
| 119 | 134 | else => @compileError("unsupported arch"), |
| 120 | 135 | } |
| 121 | 136 | // If LLVM inlines stack variables into _start, they will overwrite |